CP-Sat: Python 3.6.9, ortools 8.0.8283 wrong optimization result #2253
-
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
|
Unless you prove this is a solver issue, it is most likely a model issue. |
Beta Was this translation helpful? Give feedback.
-
|
why are you creating 2 boolvars for n1 is neighbor of n2 and n2 is neighbor of n1 ? |
Beta Was this translation helpful? Give feedback.
-
|
The following constraints are based on the out-degree and in-degree of each
node. Therefore, the edges need to be regarded as directional.
For each node:
Out-degree In-degree
the center point 0 [num_min -1, num_max-1]
non-central points 1 0
Laurent Perron <[email protected]> 于2020年12月2日周三 下午5:12写道:
… why are you creating 2 boolvars for n1 is neighbor of n2 and n2 is
neighbor of n1 ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFOKUUSCXVWBJCIWAPDHFKTSSYAILANCNFSM4UKGI5PA>
.
|
Beta Was this translation helpful? Give feedback.
-
|
Split this line into 2 constraints: |
Beta Was this translation helpful? Give feedback.
-
|
yes, this does not work IMO
Laurent Perron | Operations Research | [email protected] | (33) 1 42 68 53
00
Le mer. 2 déc. 2020 à 10:57, Xiang Chen <[email protected]> a écrit :
… Split this line into 2 constraints:
model.Add(
num_min - 1
<= sum(neighbors[i, n] for i in range(num_nodes) if i != n)
<= num_max - 1
).OnlyEnforceIf(nodes[n])
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3OXZ767GTB4O4A6H3TSSYFPZANCNFSM4UKGI5PA>
.
|
Beta Was this translation helpful? Give feedback.
-
|
It does work according to your suggestion, thank you very much. |
Beta Was this translation helpful? Give feedback.



Split this line into 2 constraints: