On Tue, Apr 17, 2012, at 06:18 PM, Andrew Makhorin wrote:
> -------- Forwarded Message --------
> From: Sylvain Fournier <address@hidden
> To: Andrew Makhorin <address@hidden
> Subject: Re: [Help-glpk] Building a graph on the fly
> Date: Tue, 17 Apr 2012 10:12:27 -0300
> Hi Andrew,
> Thanks for your quick answer. In fact, I am looking for an example in
> Java, as I can't find how to create a C struct using the Java routines,
> and how to use the offsetof macro.
> Does the '_' prefix for the class names _glp_graph, _glp_arc and
> _glp_vertex (in Java) mean something special? (I guess they are
> supported, as they can be found in the glpk-java.pdf documentation)
> Best regards.
> 2012/4/16 Andrew Makhorin <address@hidden
> > I need to solve a minimum cost flow problem in Java, and for
> this I'd
> > like to use the Out-Of-Kilter algorithm included in GLPK. I
> saw there
> > is a way to build the graph reading the information from a
> text file
> > (glp_read_graph), however I wonder whether I can do it on the
> > using some routines that modify the graph.
> > I saw I can use for example glp_create_graph,
> > glp_add_arc. On the other hand, I can't find a way to create
> or modify
> > the data associated with a vertex (demand) or an arc
> (capacity, cost).
> > I had no success in searching either into the mailing list
> > or in the files included in the GLPK distribution (examples
> > documentation). Did I miss something?
> Please see the example in Subsection 2.1.5 "Solve minimum-cost
> problem with the out-of-kilter algorithm" of the document "GLPK:
> and Network Routines" (doc/graph.pdf). You need to define your
> structs, one for each node and one for each arc of the network,
> include fields to store node supply/demand, arc capacity, etc.
> When you
> call glp_mincost_okalg, you specify with the standard offsetof
> where the input data are stored in your structs and to where the
> should store the solution components.
> Sylvain Fournier
> Analista de Pesquisa Operacional
> 48 3239-2423
> WPLEX Software Ltda.
> Rod SC 401 no. 8600 Corporate Park bloco 5 sala 101
> 88050-000 Santo Antônio de Lisboa, Florianópolis SC +55 48 3239-2400
> Help-glpk mailing list