igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] maximal.cliques returns duplicates


From: Gábor Csárdi
Subject: Re: [igraph] maximal.cliques returns duplicates
Date: Mon, 18 Nov 2013 12:23:00 -0500

On Mon, Nov 18, 2013 at 11:57 AM, Tony Larson <address@hidden> wrote:
> OK,
> Here's a toy example (and on the latest igraph) - still not behaving as
> expected??

You need to set the random seed to make this example reproducible.

>> mat <- matrix(sample(c(0,1), 100 * 100, replace = TRUE, prob = c(0.8,
>> 0.2)), 100, 100)
>> g <- graph.adjacency(mat, mode = "undirected", weighted = TRUE, diag =
>> FALSE)
>> mc <- maximal.cliques(g)
>> any(duplicated(unlist(mc)))

No, this is not good, you just create a long vector from all clique
vertices, and there will be duplicates if there is overlap.... you
need to check whether one is a subset of any of the others.

G.

[...]



reply via email to

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