> GLPK 4.39 provides the possibility to model networks and solve maximum
> network flow problems.

> Function glp_maxflow_lp() is provided to convert the network flow problem to
> a LP which can
> be solved using the simplex algorithm.

> After the problem is solved it is necessary to map the column values back to
> the arcs of the
> network to be able to output the result.

> How can the columns be reliably mapped back to arcs? Using the column labels
> created with
> sprintf(name, "x[%d,%d]", a->tail->i, a->head->i);
> seems quite awkward.

> I propose glp_maxflow_lp should return a mapping table.

All glpk network api routines use a natural ordering of arcs, which
can be explained as follows:

glp_arc *a;
int i, j;

j = 0;
for (i = 1; i <= G->nv; i++)
{  for (a = G->v[i]->out; a != NULL; a = a->t_next)
   {  j++;
      /* arc a corresponds to column j */
   }
}



_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to