Write bipartite graph into Pajek format properly

Bug #1044881 reported by Gábor Csárdi
6
This bug affects 1 person
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
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

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.

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Added in revision #2941 (0.7-main) and #2924 (0.6-main).

Changed in igraph:
status: In Progress → Fix Released
assignee: nobody → Gábor Csárdi (gabor.csardi)
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/234

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.