Comments (9)
I see, fully ground model.
from or-tools.
$ 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.
So, nodes were 1 based in the old spec. Now I need it to support 0 based and 1 based.
from or-tools.
And fixed. Thanks
from or-tools.
Thanks Mats
from or-tools.
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.
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.
from or-tools.
Ok, I changed the solver specific rewrite rules and the code.
Thanks again
from or-tools.
Related Issues (20)
- Can you please wrap an interface in R? HOT 1
- VRP with breaks minor bug? HOT 4
- java crashes with EXCEPTION_ACCESS_VIOLATION HOT 1
- Minimum Route Stops HOT 1
- [Bazel] Building on Windows against MSVC is not working
- Catalog to hold OR Tools Variables, Coefficients, Constraints
- CP-SAT: Support floating-point objective in Minizinc parser HOT 3
- how to get extreme ray for unbounded lp?
- Issue building or-tools with Python support on OpenBSD HOT 18
- recurrent crash on MacOS: libc++abi: std::out_of_range HOT 2
- A stable way to refer to the CP-SAT solver using MiniZinc HOT 5
- Building against MSVC is not working (missing `std::aligned_malloc`)
- fatal error: 'ortools/util/step_function.h' file not found HOT 2
- Lin-Kernighan operator error
- Memory-bugs in routing/parser (or ortools/base|util) codes? HOT 1
- Performance regression in `main` after an optimal solution already found HOT 3
- CP-SAT crashes with address sanitizer HOT 8
- CP-SAT returns two copies of the same solution
- Make shallow clone when fetching dependencies HOT 1
- (some?) search parameters ignored when starting with initial solution HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from or-tools.