How to find the longest path from one node to another in a sufficiently large network

Everyone, I have a question. I need to find the longest path from one node to another in the network. As shown in the figure, it is a directed network, and I currently have no idea how to implement it in the “KNIME” tool. The figure is just a simple example. If the quantity is large enough, how should I implement it.
How to implement without using programming tools such as Python or R?

The figure only shows the following results: node 1 to node 4, node 1 to node 3; Node 5 to Node 4

Hi @lichang , I don’t know how well this will work with a large data set, as internally it uses a recursive loop along, but take a look at the following workflow:

The hard work is inside this component:

which internally looks like this:

Feel free to disconnect it/open it up and have a play! :slight_smile:


Given the following network (based on your picture)

the workflow generates the following result:

Finding the shortest route is much simpler (and faster), as there is a node for that, but not for All Paths or Longest Path… Python or R would no doubt run more quickly.

3 Likes