> I have successfully decoded the plain text solver output from GLPK that > results from a DIMACS mincost input file. > > However, I am having difficulty mapping the flow values back to the > original input arcs. I originally assumed that input and output each > observed the same line ordering in the input and output text files, so > that for example the last line of solution output corresponded to the > last input arc. This does not seem to be the case, however. Lacking > labels, I'm at a loss. Can anyone assist?
If you use glpsol with --mincost option, the mincost instance is converted to lp, and every variable is assigned a symbolic name 'x[i,j]', where i and j are, resp., numbers of tail and head endpoints (nodes) of corresponding arc, that allows uniquely identifying every arc in the lp solution, say, in the output file produced with '-o' option. If you use the glpk network routines, every arc in the glp_graph object is identified directly by its pointer. Please note that the node ordinal numbers in the glp_graph object (and therefore the row ordinal numbers in the resulting lp) are the same as specified in dimacs input file. However, the order of arcs, in which they are stored in the graph object (and therefore the order of corresponding variables in which they are generated and added to the lp object) is *not* defined (in the sense that no particular ordering is used) and may differ from the order, in which they appear in the dimacs file. May note also that the dimacs format does not require the arcs to appear in the solution file in the same order as in the input data file. _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
