graph-tool 2.29 breaks backward compatibility

Hello folks,

I've discovered, while trying to fix and 'never seen before' bug in my code,
after having installed graph-tool 2.29 from an Ubuntu repo, that some new
features was not backward compatible.

For example, my error came from that fact that now, the function
`get_edges` returns by default a `Nx2` matrix, whereas it used to return
a `Nx3` matrix in prior version.

Another one is that edge property doesn't seem to accept node tuple anymore (e.g. g.ep['weights'][i,j])

After a quick search on the doc, changelog and mailing list, I didn't
find mention of these changes, so I am wandering if there is a place to
find such information, and if there may be other changes that affect the
backward compatibility in new version ?

Regards,
adrien

Hi,

Backward compatibility is not always guaranteed, and things need to move
forward.

The change for get_edges() is a just a matter of consistency, after the
function was generalized to return arbitrary properties as well (as
opposed to only the edge index).

The change for property maps never happened, since it was never possible
to access edge property maps with node tuples.

The git repository contains a very comprehensive list of changes, and
you can search there for modifications that may impact your use.

Best,
Tiago

Ps. Please do not post the same message multiple times to the mailing list.

Hello Tiago,

Tanks for the answer (sorry for the duplicate, I though my first sent
failed)

Hi,

Backward compatibility is not always guaranteed, and things need to move
forward.

The change for get_edges() is a just a matter of consistency, after the
function was generalized to return arbitrary properties as well (as
opposed to only the edge index).

The change for property maps never happened, since it was never possible
to access edge property maps with node tuples.

I don't understand, I was able to do the following before 2.29 ?

eprop = g.new_ep('int') eprop[0,2] # worked if there is an edge between

node 0 and 2 |

?

The git repository contains a very comprehensive list of changes, and
you can search there for modifications that may impact your use.

Best,
Tiago

Ps. Please do not post the same message multiple times to the mailing list.

attachment.html (4.55 KB)

I don't remember this ever being possible.

Best,
Tiago

Ok, but in this case, is there a way to avoid the complexity of calling
`g.edge` to get a edge property, if we know the indexes i and j of the
nodes? what would be to best way to proceed ?

Regards,
Adrien

Graph-tool uses an adjacency list data structure, which does not allow
for an O(1) random access to edges. The best that can be done is
O(min(k_i, k_j)) which is what Graph.edge() does.