help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Solving shortest path problem and getting wrong answer


From: Andrew Makhorin
Subject: Re: [Help-glpk] Solving shortest path problem and getting wrong answer
Date: Thu, 22 Apr 2010 23:31:42 +0400

> I'm trying to solve shortest path problem using glpsol and mps format. I
> have it working correct with one example but I'm getting wrong results
> with another one and I can't understand if there's something wrong with
> my input or if it's glpsol that gives wrong output.

> My directed graph is the following, first number being edge tail id, the
> second one head id and last one respective weight.
> ...

> I haven't verified all of these but X1 being 9 cannot be correct looking
> at graph data. There's no way to get from 5 to 1 with total weight of 9.
> I can't see anything wrong with my input though.
> All help and pointers appreciated.

Glpsol solves your instance correctly, so you need to check your mps
file.

Writing models in mps format by hand is cumbersome. You may look at
the example model spp.mod, which solves the shortest path problem and
is written in MathProg modeling language (see subdirectory 'examples').





reply via email to

[Prev in Thread] Current Thread [Next in Thread]