igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] don't understand behavior of maximal cliques


From: Gábor Csárdi
Subject: Re: [igraph] don't understand behavior of maximal cliques
Date: Sat, 26 Oct 2013 12:41:24 -0400

A maximal clique is a clique, i.e. a completely connected subgraph. In other words, a subgraph that contains all possible edges between its vertices.

Maybe you are looking for connected components (clusters() in igraph) instead of maximal cliques. http://en.wikipedia.org/wiki/Connected_component_(graph_theory)

Gabor


On Sat, Oct 26, 2013 at 11:45 AM, Michael Rooney <address@hidden> wrote:
Hi,

I am new to igraph, and the behavior of the clique functions is completely confusing me.

I created the following graph:

dframe <-
data.frame(var1=c("one","one","one","five","seven","eight","nine"),
           var2=c("two","three","four","six","six","six","ten"))
g <- graph.data.frame(dframe, directed=FALSE)

When I run get.edgelist(g), the result is exactly as I would expect:
     [,1]    [,2]
[1,] "one"   "two"
[2,] "one"   "three"
[3,] "one"   "four"
[4,] "five"  "six"
[5,] "seven" "six"
[6,] "eight" "six"
[7,] "nine"  "ten"

However, when I run maximal.cliques(g), the result seems wrong to me:
[[1]]
[1] 10  5
[[2]]
[1] 9 4
[[3]]
[1] 9 3
[[4]]
[1] 9 2
[[5]]
[1] 1 8
[[6]]
[1] 1 7
[[7]]
[1] 1 6

I was expecting three maximal cliques (the first containing vertices one, two, three, and four; the second containing vertices five, six, seven, and eight; the third containing vertices nine and ten). But none to the cliques returned are larger than size 2.

However, when I do:
g <- graph.full(5,directed=FALSE)
maximal.cliques(g)
The result is exactly what I would expect:
[[1]]
[1] 1 2 3 4 5

What am I doing wrong??

Thanks,
Mike

_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]