Simple projection of bipartite (two-mode) graph not working in igraph 0.7.1



Consider this simple, bipartite graph in GraphML:



<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://ift.tt/QM36aN"
xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/QM36aN
http://ift.tt/1guo4q0">
<key id="type" for="node" attr.name="type" attr.type="boolean">
<default>TRUE</default>
</key>
<graph id="G" edgedefault="directed">
<node id='p1'><data key='type'>FALSE</data></node>
<node id='o1'></node>
<node id='o2'></node>
<edge id='e1' source='p1' target='o1'></edge>
<edge id='e2' source='p1' target='o2'></edge>
</graph>
</graphml>


Now consider this R session:



require("igraph")
graph <- read.graph(file="bipartitetest.graphml",format="graphml")
proj <- bipartite.projection(graph)


Although the graph object seems fine:



graph
IGRAPH D--B 3 2 --
+ attr: type (v/l), id (v/c), id (e/c)


my igraph version 0.7.1 complains:



Error in .Call("R_igraph_bipartite_projection", graph, types, as.integer(probe1), :
At bipartite.c:198 : Non-bipartite edge found in bipartite projection, Invalid value


Why is that? The simple graph seems to be valid a-priori.


No comments:

Post a Comment