Longest path in a weighted cyclic digraph

116 Views Asked by At

I have a weighted cyclic digraph with no more than 30 nodes. Theoretically, there's no restriction on the number of arcs, but it'd be ok if I had to cap it at 1230. I need to find the path with the largest overall weight where no vertex is visited more than once. It is, however, allowed for vertices not to be visited at all. All of the weights will be positive. Is it possible to do this in polynomial time?

Edit: The weights on the edges will not all be 1, they will be ranging from 1-100.

1

There are 1 best solutions below

0
On BEST ANSWER

If all the edge weights have weight 1, then directed Hamiltonian path problem reduces to this special case, so there is no polynomial time algorithm for a general graph (assuming NP$\not =$P). (Same if the weights are on the nodes.)

However, since your graph is small, and presumably special in structure, it may be possible to solve your problem.