Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neighbors Network filter freezes with max depth #2099

Closed
lame-impala opened this issue Apr 13, 2019 · 2 comments
Closed

Neighbors Network filter freezes with max depth #2099

lame-impala opened this issue Apr 13, 2019 · 2 comments

Comments

@lame-impala
Copy link

lame-impala commented Apr 13, 2019

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

  1. Create graph from the data in the attached file

test.txt

  1. run Neighbors Network filter
  • Version used: Gephi 0.9.2
  • Java version: 1.8.0_171
  • Operating System: Ubuntu
@BenWeigt
Copy link

BenWeigt commented Apr 25, 2020

Still an issue 12 months later

@eduramiba eduramiba self-assigned this Apr 25, 2020
@eduramiba eduramiba added this to the 0.9.3 milestone Apr 25, 2020
@eduramiba eduramiba added the High label Apr 25, 2020
@mbastian mbastian assigned mbastian and unassigned eduramiba Dec 28, 2021
@mbastian
Copy link
Member

Thanks for the report - I do appreciate the details - this has been fixed in master now and will be included in the next 0.9.3 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants