Project: Моделирование труднорешаемых задач
Views: 22Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2204Kernel: Python 3 (ipykernel)
In [78]:
In [79]:
In [80]:
In [104]:
In [6]:
In [82]:
In [83]:
In [84]:
2 Set Declarations
IJ : Size=1, Index=None, Ordered=True
Key : Dimen : Domain : Size : Members
None : 2 : J*J : 25 : {(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 0), (4, 1), (4, 2), (4, 3), (4, 4)}
IJ1 : Size=1, Index=None, Ordered=Insertion
Key : Dimen : Domain : Size : Members
None : 2 : Any : 12 : {(1, 2), (1, 3), (1, 4), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (3, 4), (4, 1), (4, 2), (4, 3)}
2 RangeSet Declarations
I1 : Dimen=1, Size=4, Bounds=(1, 4)
Key : Finite : Members
None : True : [1:4]
J : Dimen=1, Size=5, Bounds=(0, 4)
Key : Finite : Members
None : True : [0:4]
2 Var Declarations
u : Size=4, Index=I1
Key : Lower : Value : Upper : Fixed : Stale : Domain
1 : 0 : None : 3 : False : True : Reals
2 : 0 : None : 3 : False : True : Reals
3 : 0 : None : 3 : False : True : Reals
4 : 0 : None : 3 : False : True : Reals
x : Size=25, Index=IJ
Key : Lower : Value : Upper : Fixed : Stale : Domain
(0, 0) : 0 : None : 1 : False : True : Binary
(0, 1) : 0 : None : 1 : False : True : Binary
(0, 2) : 0 : None : 1 : False : True : Binary
(0, 3) : 0 : None : 1 : False : True : Binary
(0, 4) : 0 : None : 1 : False : True : Binary
(1, 0) : 0 : None : 1 : False : True : Binary
(1, 1) : 0 : None : 1 : False : True : Binary
(1, 2) : 0 : None : 1 : False : True : Binary
(1, 3) : 0 : None : 1 : False : True : Binary
(1, 4) : 0 : None : 1 : False : True : Binary
(2, 0) : 0 : None : 1 : False : True : Binary
(2, 1) : 0 : None : 1 : False : True : Binary
(2, 2) : 0 : None : 1 : False : True : Binary
(2, 3) : 0 : None : 1 : False : True : Binary
(2, 4) : 0 : None : 1 : False : True : Binary
(3, 0) : 0 : None : 1 : False : True : Binary
(3, 1) : 0 : None : 1 : False : True : Binary
(3, 2) : 0 : None : 1 : False : True : Binary
(3, 3) : 0 : None : 1 : False : True : Binary
(3, 4) : 0 : None : 1 : False : True : Binary
(4, 0) : 0 : None : 1 : False : True : Binary
(4, 1) : 0 : None : 1 : False : True : Binary
(4, 2) : 0 : None : 1 : False : True : Binary
(4, 3) : 0 : None : 1 : False : True : Binary
(4, 4) : 0 : None : 1 : False : True : Binary
1 Objective Declarations
obj : Size=1, Index=None, Active=True
Key : Active : Sense : Expression
None : True : minimize : 1000000000*x[0,0] + 169*x[0,1] + 188*x[0,2] + 50*x[0,3] + 153*x[0,4] + 169*x[1,0] + 1000000000*x[1,1] + 117*x[1,2] + 125*x[1,3] + 105*x[1,4] + 188*x[2,0] + 117*x[2,1] + 1000000000*x[2,2] + 140*x[2,3] + 36*x[2,4] + 50*x[3,0] + 125*x[3,1] + 140*x[3,2] + 1000000000*x[3,3] + 105*x[3,4] + 153*x[4,0] + 105*x[4,1] + 36*x[4,2] + 105*x[4,3] + 1000000000*x[4,4]
4 Constraint Declarations
MillerTuckerZemlin : Size=12, Index=IJ1, Active=True
Key : Lower : Body : Upper : Active
(1, 2) : -Inf : u[1] - u[2] + 5*x[1,2] : 4.0 : True
(1, 3) : -Inf : u[1] - u[3] + 5*x[1,3] : 4.0 : True
(1, 4) : -Inf : u[1] - u[4] + 5*x[1,4] : 4.0 : True
(2, 1) : -Inf : u[2] - u[1] + 5*x[2,1] : 4.0 : True
(2, 3) : -Inf : u[2] - u[3] + 5*x[2,3] : 4.0 : True
(2, 4) : -Inf : u[2] - u[4] + 5*x[2,4] : 4.0 : True
(3, 1) : -Inf : u[3] - u[1] + 5*x[3,1] : 4.0 : True
(3, 2) : -Inf : u[3] - u[2] + 5*x[3,2] : 4.0 : True
(3, 4) : -Inf : u[3] - u[4] + 5*x[3,4] : 4.0 : True
(4, 1) : -Inf : u[4] - u[1] + 5*x[4,1] : 4.0 : True
(4, 2) : -Inf : u[4] - u[2] + 5*x[4,2] : 4.0 : True
(4, 3) : -Inf : u[4] - u[3] + 5*x[4,3] : 4.0 : True
columns_check : Size=5, Index=J, Active=True
Key : Lower : Body : Upper : Active
0 : 1.0 : x[0,0] + x[1,0] + x[2,0] + x[3,0] + x[4,0] : 1.0 : True
1 : 1.0 : x[0,1] + x[1,1] + x[2,1] + x[3,1] + x[4,1] : 1.0 : True
2 : 1.0 : x[0,2] + x[1,2] + x[2,2] + x[3,2] + x[4,2] : 1.0 : True
3 : 1.0 : x[0,3] + x[1,3] + x[2,3] + x[3,3] + x[4,3] : 1.0 : True
4 : 1.0 : x[0,4] + x[1,4] + x[2,4] + x[3,4] + x[4,4] : 1.0 : True
lines_check : Size=5, Index=J, Active=True
Key : Lower : Body : Upper : Active
0 : 1.0 : x[0,0] + x[0,1] + x[0,2] + x[0,3] + x[0,4] : 1.0 : True
1 : 1.0 : x[1,0] + x[1,1] + x[1,2] + x[1,3] + x[1,4] : 1.0 : True
2 : 1.0 : x[2,0] + x[2,1] + x[2,2] + x[2,3] + x[2,4] : 1.0 : True
3 : 1.0 : x[3,0] + x[3,1] + x[3,2] + x[3,3] + x[3,4] : 1.0 : True
4 : 1.0 : x[4,0] + x[4,1] + x[4,2] + x[4,3] + x[4,4] : 1.0 : True
zero_at_diag : Size=5, Index=J, Active=True
Key : Lower : Body : Upper : Active
0 : 0.0 : x[0,0] : 0.0 : True
1 : 0.0 : x[1,1] : 0.0 : True
2 : 0.0 : x[2,2] : 0.0 : True
3 : 0.0 : x[3,3] : 0.0 : True
4 : 0.0 : x[4,4] : 0.0 : True
11 Declarations: J IJ x obj zero_at_diag lines_check columns_check I1 IJ1 u MillerTuckerZemlin
In [89]:
# ==========================================================
# = Solver Results =
# ==========================================================
# ----------------------------------------------------------
# Problem Information
# ----------------------------------------------------------
Problem:
- Name: unknown
Lower bound: 477.0
Upper bound: 477.0
Number of objectives: 1
Number of constraints: 22
Number of variables: 24
Number of binary variables: 25
Number of integer variables: 25
Number of nonzeros: 20
Sense: minimize
# ----------------------------------------------------------
# Solver Information
# ----------------------------------------------------------
Solver:
- Status: ok
User time: -1.0
System time: 0.28
Wallclock time: 0.06
Termination condition: optimal
Termination message: Model was solved to optimality (subject to tolerances), and an optimal solution is available.
Statistics:
Branch and bound:
Number of bounded subproblems: 0
Number of created subproblems: 0
Black box:
Number of iterations: 9
Error rc: 0
Time: 0.11193680763244629
# ----------------------------------------------------------
# Solution Information
# ----------------------------------------------------------
Solution:
- number of solutions: 0
number of solutions displayed: 0
{(0, 0): 0.0,
(0, 1): 1.0,
(0, 2): 0.0,
(0, 3): 0.0,
(0, 4): 0.0,
(1, 0): 0.0,
(1, 1): 0.0,
(1, 2): 1.0,
(1, 3): 0.0,
(1, 4): 0.0,
(2, 0): 0.0,
(2, 1): 0.0,
(2, 2): 0.0,
(2, 3): 0.0,
(2, 4): 1.0,
(3, 0): 1.0,
(3, 1): 0.0,
(3, 2): 0.0,
(3, 3): 0.0,
(3, 4): 0.0,
(4, 0): 0.0,
(4, 1): 0.0,
(4, 2): 0.0,
(4, 3): 1.0,
(4, 4): 0.0}
In [85]:
In [87]:
In [96]:
In [97]:
In [98]:
684
In [99]:
In [106]:
In [0]: