igraph-help
[Top][All Lists]
Advanced

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

[igraph] Contracting two vertices into one in Igraph - error


From: Priyanka Kadiyala
Subject: [igraph] Contracting two vertices into one in Igraph - error
Date: Wed, 7 Nov 2012 18:55:38 -0600

Hello All,

I'm trying to implement the Nagamochi-Ibaraki algorithm and have the following problem:

I have picked two vertices, say "x" and "y" that need to be contracted into a single vertex. I have tried to understand the contract.vertices function but the mapping parameter is confusing me. The total vertices in my graph are 26, and they will be contracted recursively until I have only 2 nodes left. Can you please help me with this? I'm not sure what I'm doing wrong.

My graph is this: g1 <- barabasi.game(26, m=4, directed=FALSE, algorithm="bag")

And after I pick two nodes, say 25, 26, which have multiple edges between them, I'm trying to merge them into a single vertex:

> g2 <- contract.vertices(g1,(25:26),vertex.attr.comb=toString)
Error in contract.vertices(g1, (25:26), vertex.attr.comb = toString) :
  At structural_properties.c:6922 : Invalid mapping vector length, Invalid value

Thank you,
Krishna.

reply via email to

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