Coder Social home page Coder Social logo

Comments (9)

lperron avatar lperron commented on June 14, 2024

I see, fully ground model.

from or-tools.

matsc-at-sics-se avatar matsc-at-sics-se commented on June 14, 2024
$ cat /tmp/latest.fzn
predicate ortools_network_flow_cost(array [int] of int: arc,array [int] of int: balance,array [int] of int: weight,array [int] of var int: flow,var int: cost);
array [1..6] of int: X_INTRODUCED_17_ = [0,2,0,2,1,1];
array [1..6] of int: X_INTRODUCED_18_ = [2,1,1,0,0,1];
array [1..3] of int: X_INTRODUCED_20_ = [1,1,-2];
array [1..12] of int: X_INTRODUCED_21_ = [0,1,0,2,1,0,1,2,2,0,2,1];
constraint ortools_network_flow_cost(X_INTRODUCED_21_,X_INTRODUCED_20_,X_INTRODUCED_18_,X_INTRODUCED_17_,3);
solve  satisfy;

from or-tools.

lperron avatar lperron commented on June 14, 2024

So, nodes were 1 based in the old spec. Now I need it to support 0 based and 1 based.

from or-tools.

lperron avatar lperron commented on June 14, 2024

And fixed. Thanks

from or-tools.

lperron avatar lperron commented on June 14, 2024

Thanks Mats

from or-tools.

lperron avatar lperron commented on June 14, 2024

I have an issue with your model.

The balance array is indexed by 1..3

but your nodes are valued from 0 to 2.

IMO, the model is invalid.

from or-tools.

matsc-at-sics-se avatar matsc-at-sics-se commented on June 14, 2024

No, Laurent. The given constraint was:

constraint
  network_flow_cost(array2d(1..6,1..2,[0,1,0,2,1,0,1,2,2,0,2,1]),
                    array1d(0..2,[1,1,-2]),
                    [2,1,1,0,0,1],
                    [0,2,0,2,1,1],
                    3);

with balance array indexed by 0..2. Since the index sets disappear in the FlatZinc, you need to pass a node base parameter to ortools_network_flow_cost, like for circuit.

from or-tools.

lperron avatar lperron commented on June 14, 2024

from or-tools.

lperron avatar lperron commented on June 14, 2024

Ok, I changed the solver specific rewrite rules and the code.

Thanks again

from or-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.