Algorithm to find largest weight path of a graph where weight is given by multiplication

1.3k Views Asked by At

So my problem is to find the longest path from a node to another node (or the same node) in a graph implemented with Networkx library.

I don't want to add the edges' weights but multiply them and take the biggest result. Obviously, passing only once by each node or not at all.

For example if I want to go from node 1 to node 4, the best result would be : 2 x 14 x 34 x 58

Graph example enter image description here

Thank you for your help !