graphstream / gs-core

Graphstream core
http://graphstream-project.org/
Other
400 stars 108 forks source link

s.getEdgeBetween(t) return null if the edge goes from t to s #330

Closed Tyneor closed 4 years ago

Tyneor commented 4 years ago

Setup :

graph = new SingleGraph();
s = graph.addNode("s")
t = graph.addNode("t")
graph.addEdge("st", "s", "t", true);

The documentation states for getEdgeBetween that "This method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected. "

However, hasEdgeBetween/getEdgeBetween work fine when the edge goes toward the target :

s.hasEdgeFrom(t) : false
s.hasEdgeToward(t) : true
s.hasEdgeBetween(t) : true

but don't when the edge leaves the target :

t.hasEdgeFrom(s) : true
t.hasEdgeToward(s) : false
t.hasEdgeBetween(s) : false //it should be true
pigne commented 4 years ago

This bug has been identified, indeed. Since it implies a heavy refactoring we won't fix it on the 1.3 branch.

Release 2.0 will contain a fix for this problem. In the meantime you can use the dev branch.

Tyneor commented 4 years ago

Thanks!