Il 19/06/2010 17:17, Michele Comignano ha scritto:
I'm modeling a flow problem on graph using sage.
Once the graph was ready I've modeled a MILP problem with constraints.
I've problems having unique variables.
What I do is to use v = p.new_variable() and subsequently use the v
variable in a loop iterating the edges of the graph in such as:
for origin, destination, attributes in G.edges():
attributes['v_component_for_that_edgs'] = v[('origin',
'destination')]
But at the end some variable are duplicate!
The code producing that strange behavior is attached to this mail.
Is an error of mine or a Sage problem?
Thanks.
It's an error of mine, sorry for garbage. I was considering the third
element of the tuple in sage graph's edges as a dictionary (as networkx
does), but it's only a label! Everithing's ok now and sage is great for
linear programming :).
--
Michele Comignano
Computer Science student
University of Pisa
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org