[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [Help-glpk] Building a graph on the fly

**From**: |
Andrew Makhorin |

**Subject**: |
Re: [Help-glpk] Building a graph on the fly |

**Date**: |
Wed, 18 Apr 2012 12:11:40 +0400 |

Hi Xypron,
>* glp_arc and glp_vertex both have a field data in which information like*
>* *
>* double a_cap; // arc capacity*
>* double a_cost; // arc cost*
>* double a_low; // lower bound*
>* double a_x; // arc flow*
>* *
>* int v_cut; // 0: node is unlabelled, 1: node is labelled*
>* double v_pi; // node potential*
>* double v_rhs; // supply/demand value*
>* int v_set; // 0: vertex is in set R, 1: vertex is in set S*
>* *
>* is stored.*
>* *
>* glpk.h does not provide structures with these fields.*
>* *
>* I will have to change the GLPK for Java code to provide these*
>* structures and the constants needed (length of the data fields, and*
>* offsets).*
Do you mean a hardcoding? If so, this would reduce applicability only to
the cases you implement. In complex problems nodes and arcs may have
additional attributes not directly related to mincost, and it would be
inconvenient to store them somewhere else. I would suggest to implement
more general routines (in Java) that allow the user to store/load an int
or double to/from a node/arc at the specified offset (measured in
bytes).