You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a trivial circular graph defined with four nodes. Neighbors Network filter with max depth setting run when all nodes are visible should simply leave all nodes visible
Current Behavior
Filter hangs for infinity
Possible Solution
In the function that actually performs filtering, keep track of the visited nodes and check whether each candidate has been visited before adding it into neighbors array
public Graph filter(Graph) {
...
Collection nodes = graph.getNodes().toCollection();
Set seen = new HashSet(nodes);
...
for (Node n : nei) {
//Extract all neighbors of n
for (Node neighbor : mainGraph.getNeighbors(n)) {
if (!seen.contains(neighbor)) {
neighbours.add(neighbor);
seen.add(neighbor);
result.add(neighbor);
}
}
...
}
Expected Behavior
I have a trivial circular graph defined with four nodes. Neighbors Network filter with max depth setting run when all nodes are visible should simply leave all nodes visible
Current Behavior
Filter hangs for infinity
Possible Solution
In the function that actually performs filtering, keep track of the visited nodes and check whether each candidate has been visited before adding it into neighbors array
public Graph filter(Graph) {
...
Collection nodes = graph.getNodes().toCollection();
Set seen = new HashSet(nodes);
...
for (Node n : nei) {
//Extract all neighbors of n
for (Node neighbor : mainGraph.getNeighbors(n)) {
if (!seen.contains(neighbor)) {
neighbours.add(neighbor);
seen.add(neighbor);
result.add(neighbor);
}
}
...
}
Steps to Reproduce
test.txt
The text was updated successfully, but these errors were encountered: