polygonal/ds

Removing nodes from graph depends on order of adding nodes

Closed this issue · 0 comments

var graph:Graph<Int> = new Graph<Int>();
graph.addNode(graph.createNode(5));
graph.addNode(graph.createNode(3));
trace(graph.size());

// test 1
trace(graph.remove(5));
trace(graph.remove(3));

// test 2 - reverse order
//trace(graph.remove(3));
//trace(graph.remove(5));

for test 1

Main.hx:118: true
Main.hx:119: true

for test 2

Main.hx:121: true
Main.hx:122: false

Tested for dev branch.

Bug or feature?