igraph-help
[Top][All Lists]
Advanced

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

[igraph] don't understand behavior of maximal cliques


From: Michael Rooney
Subject: [igraph] don't understand behavior of maximal cliques
Date: Sat, 26 Oct 2013 11:45:52 -0400

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

reply via email to

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