B
B
beduin012020-02-28 11:33:59
JavaScript
beduin01, 2020-02-28 11:33:59

How to bypass the graph?

I have a graph like https://jsfiddle.net/0gf3mj6L/
I need to remove all nodes and leave only the connection between Company 0 and Company 6. To get it like this:

jpI4M.png

How to do it? Maybe there are some ready-made libraries so that the solution is not to write it yourself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexalexes, 2020-02-28
@beduin01

Find a path using Dijkstra's algorithm between two vertices of interest.
Clear all vertices and arcs that are not included in this path.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question