Project: Моделирование труднорешаемых задач
Views: 16Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu2204Kernel: Python 3 (ipykernel)
In [1]:
In [2]:
(array([[38, 3, 56, 83, 95],
[95, 58, 46, 40, 46],
[14, 91, 61, 71, 72],
[96, 1, 37, 9, 41],
[30, 73, 32, 33, 73],
[28, 77, 57, 56, 94],
[ 8, 96, 62, 31, 61],
[48, 91, 54, 29, 92],
[64, 54, 51, 68, 37],
[39, 67, 39, 30, 85]]),
array([95., 95., 91., 96., 73., 94., 96., 92., 68., 85.]),
array([1, 0, 0, 0, 1]))
In [3]:
2 Set Declarations
x_index : Size=1, Index=None, Ordered=Insertion
Key : Dimen : Domain : Size : Members
None : 1 : Any : 5 : {0, 1, 2, 3, 4}
строчка_не_больше_index : Size=1, Index=None, Ordered=Insertion
Key : Dimen : Domain : Size : Members
None : 1 : Any : 10 : {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
1 Var Declarations
x : Size=5, Index=x_index
Key : Lower : Value : Upper : Fixed : Stale : Domain
0 : 0 : None : 1 : False : True : Binary
1 : 0 : None : 1 : False : True : Binary
2 : 0 : None : 1 : False : True : Binary
3 : 0 : None : 1 : False : True : Binary
4 : 0 : None : 1 : False : True : Binary
1 Objective Declarations
obj : Size=1, Index=None, Active=True
Key : Active : Sense : Expression
None : True : maximize : x[0] + 0*x[1] + 0*x[2] + 0*x[3] + x[4]
1 Constraint Declarations
строчка_не_больше : Size=10, Index=строчка_не_больше_index, Active=True
Key : Lower : Body : Upper : Active
0 : -Inf : 38*x[0] + 3*x[1] + 56*x[2] + 83*x[3] + 95*x[4] : 95.0 : True
1 : -Inf : 95*x[0] + 58*x[1] + 46*x[2] + 40*x[3] + 46*x[4] : 95.0 : True
2 : -Inf : 14*x[0] + 91*x[1] + 61*x[2] + 71*x[3] + 72*x[4] : 91.0 : True
3 : -Inf : 96*x[0] + x[1] + 37*x[2] + 9*x[3] + 41*x[4] : 96.0 : True
4 : -Inf : 30*x[0] + 73*x[1] + 32*x[2] + 33*x[3] + 73*x[4] : 73.0 : True
5 : -Inf : 28*x[0] + 77*x[1] + 57*x[2] + 56*x[3] + 94*x[4] : 94.0 : True
6 : -Inf : 8*x[0] + 96*x[1] + 62*x[2] + 31*x[3] + 61*x[4] : 96.0 : True
7 : -Inf : 48*x[0] + 91*x[1] + 54*x[2] + 29*x[3] + 92*x[4] : 92.0 : True
8 : -Inf : 64*x[0] + 54*x[1] + 51*x[2] + 68*x[3] + 37*x[4] : 68.0 : True
9 : -Inf : 39*x[0] + 67*x[1] + 39*x[2] + 30*x[3] + 85*x[4] : 85.0 : True
5 Declarations: x_index x obj строчка_не_больше_index строчка_не_больше
In [4]:
In [5]:
# ==========================================================
# = Solver Results =
# ==========================================================
# ----------------------------------------------------------
# Problem Information
# ----------------------------------------------------------
Problem:
- Name: unknown
Lower bound: 1.0
Upper bound: 1.0
Number of objectives: 1
Number of constraints: 8
Number of variables: 2
Number of binary variables: 5
Number of integer variables: 5
Number of nonzeros: 2
Sense: maximize
# ----------------------------------------------------------
# Solver Information
# ----------------------------------------------------------
Solver:
- Status: ok
User time: -1.0
System time: 0.0
Wallclock time: 0.01
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: 0
Error rc: 0
Time: 0.04661393165588379
# ----------------------------------------------------------
# Solution Information
# ----------------------------------------------------------
Solution:
- number of solutions: 0
number of solutions displayed: 0
x[0] 1.0
In [ ]:
In [ ]: