1

I'm using the cytoscape.js graph library on a website I am creating here: http://consulting.citi.co.uk/

My query is, does anyone have an example using Dijkstra algorithm or Traversing to show multiple relationships on node select / hover? I have made it work using the demo, but it only traces one route on load: How to highlight the path between two nodes in CYTOSCAPE JS

Community
  • 1
  • 1

1 Answers1

1

I'm not sure I understand. Do you mean you want to show the directly connected relationships? In that case, it's even simpler than Dijkstra or BFS: You can use the neighbourhood: http://js.cytoscape.org/#collection/traversing/eles.neighborhood

Or maybe you're looking for something more along the lines of the BFS demo? http://jsbin.com/gist/7e2f4d29ff7ef1a1bba5?js,output

maxkfranz
  • 11,896
  • 1
  • 27
  • 36
  • I have used neighbourhood on the current example, but what I would like to do is trace back to a node 3 or 4 nodes away using existing edges (without creating a direct link, as that looks messy). – Paul Ashton Nov 27 '14 at 15:08
  • If you're looking for a path between two particular nodes, you should use A* (`eles.aStar()`). – maxkfranz Nov 27 '14 at 19:18