dagrejs / graphlib

A directed multi-graph library for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sinks method returns incorrect output for undirected graph

lynxaegon opened this issue · comments

Hi,

{ options: { directed: false, multigraph: false, compound: false },
  nodes:
   [ { v: 'a' },
     { v: 'b' },
     { v: 'c' },
     { v: 'd' } ],
  edges:
   [ { v: 'a', w: 'b' }, { v: 'b', w: 'c' }, { v: 'c', w: 'd' } ] }

This is how i define the graph:

var g = new graphlib.Graph({
	directed: false
});

g.setEdge("a", "b");
g.setEdge("b", "c");
g.setEdge("c", "d");
g.sinks() -> returns "d"

The graph is undirected, wouldn't that mean that "d" is connected to "c"?