Write bipartite graph into Pajek format properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Fix Released
|
Medium
|
Gábor Csárdi |
Bug Description
I.e. if the 'type' vertex attribute is present, then create a bipartite pajek file.
A problem is that we need to reorder the vertices, because in Pajek bipartite graphs the vertices are ordered according to vertex type.
Another problem is that in R the logical vertex attribute is not supported by the attribute handler API directly, so we need to do something about this. Possible solutions:
- the vertex types could be in an explicit argument to write_graph_pajek. This is not bad, although it is an API change, so it could only go to 0.7. Plus, this argument would be almost never used. But there are already plenty of arguments like that in igraph.
- another type could be used to denote vertex types, but we only have numeric and character, and they are not very good, because they would waste a lot of memory.
- introduce the 'logical' or 'boolean' type in the attribute handler. Not bad, but unfortunately igraph_bool_t is int, probably because it is an int in R as well. It would be better to use a char. Anyway.
- implement something to handle complex attribute types, although I am not sure how exactly this would work for the problem at hand.
This could go into 0.6.1, if it does not require an API change.
description: | updated |
Changed in igraph: | |
status: | Confirmed → In Progress |
I ended up adding a boolean attribute type. It might be still fine for 0.6.1, because it is only an extension of the API, and not a change.