Skip to content

Sinks method returns incorrect output for undirected graph #101

Open
@lynxaegon

Description

@lynxaegon

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"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions