🚀 Quick Start¶
This notebook shows the minimum steps needed to run a electrical network optimization in a wind farm via OptiWindNet.
Steps¶
An network optimization via OptiWindNet involves two components:
A
WindFarmNetworkcontaining the problem data.A
Routerdescribing the method used to solve it.
The network optimization can be performed using following steps:
Create a
WindFarmNetworkinstanceDefine a router
Run the optimization and get the results
1. Create a WindFarmNetwork instance¶
The WindFarmNetwork component stores the turbine layout and runs optimization (storing the optimized network after running an optimization). See WindFarmNetwork and Router for some of the important methods and functionalities provided by this component.
[1]:
from optiwindnet.api import WindFarmNetwork
[2]:
import matplotlib.pyplot as plt
# Display figures as SVG in Jupyter notebooks
%config InlineBackend.figure_formats = ['svg']
Load location data¶
Note: For details about OptiWindNet’s
load_repository(), check Load repositories containing location data.
[3]:
from optiwindnet.api import load_repository
locations = load_repository()
L = locations.doggerA
Initialize a WindFarmNetwork instance with a prebuilt L and a desired maximum cable capacity (See Data Input for various input formats.)
[4]:
wfn = WindFarmNetwork(L=L, cables=8)
We can plot the location to make sure wfn is created with the correct data.
Tip. In a notebook, just put
wfnas the last line of a cell for plotting G.
Before optimization (no
Gyet), it renders the location geometryL.If
Gexists (e.g. after aoptimize()is run), it automatically rendersG.We could use
wfn.plot_location()for plotting the location geometry. For more details look into the notebook about plotting
[5]:
wfn
[5]:
2. Define a Router¶
Three built-in routers are available in OptiWindNet :
Router |
Speed |
Accuracy |
Notes |
|---|---|---|---|
EWRouter |
⭐⭐⭐ |
⭐ |
Very fast heuristic |
HGSRouter |
⭐⭐ |
⭐⭐ |
Radial topology |
MILPRouter |
⭐ |
⭐⭐⭐ |
Exact MILP solver |
See WindFarmNetwork and Router for details about routers.
EWRouter¶
To use this router, simply create an instance of the EWRouter class. All arguments are optional, making it quick and easy to get started with minimal configuration.
[6]:
from optiwindnet.api import EWRouter
[7]:
ew_router = EWRouter()
HGSRouter¶
To use this router, create an instance of the HGSRouter class. The only required argument is time_limit, which defines how long the optimization is allowed to run (in seconds).
[8]:
from optiwindnet.api import HGSRouter
[9]:
hgs_router = HGSRouter(time_limit=1)
MILPRouter¶
To use this router, create an instance of the MILP class. You must provide:
solver_name: the MILP solver to use (e.g.,'ortools','gurobi','cbc')time_limit: maximum time allowed for solving (in seconds)mip_gap: acceptable optimality gap (e.g.,0.005= 0.5%)
Optional arguments:
verbose(default: False): set toTrueto display solver progress and detailed logssolver_options: dictionary of solver-specific parametersmodel_options: advanced model settings (e.g., topology, feeder configuration)
[10]:
from optiwindnet.api import MILPRouter
[11]:
milp_router = MILPRouter(solver_name='ortools', time_limit=20, mip_gap=0.005, verbose=True)
3. Run the optimization¶
EWRouter (very fast)¶
[12]:
%%timeit
res_ew = wfn.optimize(router=ew_router)
30.9 ms ± 6.5 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
[13]:
wfn.solution_info()
[13]:
{'router': 'EWRouter', 'capacity': 8, 'iterations': 83}
[14]:
wfn.length()
[14]:
264936.30102115136
Plot optimized network
Note: we could use
wfn.plot()for plotting the optimized network. For more details look into the notebook about plotting
[15]:
wfn
[15]:
Note: When calling
.optimize()multiple times on the sameWindFarmNetworkinstance, the previously stored solution and related information (e.g., network graph, cost, length) will be overwritten. You can verify this by checking the updated total length or by re-plotting the optimized network and comparing it to the earlier result.
HGSRouter (fast - radial only solutions)¶
[16]:
res_hgs = wfn.optimize(router=hgs_router)
[17]:
wfn.solution_info()
[17]:
{'router': 'HGSRouter',
'capacity': 8,
'solver_name': 'HGS-CVRP',
'feeders_above_min': None,
'complete': False,
'nbGranular': 20,
'mu': 25,
'lambda_': 40,
'nbElite': 4,
'nbClose': 5,
'nbIterPenaltyManagement': 100,
'targetFeasible': 0.2,
'penaltyDecrease': 0.85,
'penaltyIncrease': 1.2,
'seed': 406089763685306098,
'nbIter': 20000,
'nbIterTraces': 500,
'timeLimit': 1,
'useSwapStar': True,
'runtime': 1.0}
[18]:
wfn.length()
[18]:
243082.83829893867
[19]:
wfn
[19]:
Note that the HGSRouter always produces a network with radial topology.
A radial topology means that each turbine has at most two connections (maximum degree of 2). Contrast that with the default branched topology, where there is no limit on the number of connections of each turbine. See the figure below for an illustrative example.
[20]:
from optiwindnet.synthetic import toyfarm
from optiwindnet.api import ModelOptions
[21]:
fig, (axl, axr) = plt.subplots(1, 2, facecolor='none')
wfn_toy = WindFarmNetwork(L=toyfarm(), cables=4)
opt_milp = dict(mip_gap=0.001, time_limit=5, solver_name='ortools')
axl.set_title('Radial', color='#888888')
wfn_toy.optimize(
router=MILPRouter(**opt_milp,
model_options=ModelOptions(topology='radial', feeder_limit='minimum'))
)
wfn_toy.plot(ax=axl, infobox=False)
axr.set_title('Branched', color='#888888');
wfn_toy.optimize(
router=MILPRouter(**opt_milp,
model_options=ModelOptions(topology='branched', feeder_limit='minimum'))
)
wfn_toy.plot(ax=axr, infobox=False);
MILPRouter¶
(high-quality solutions with guarantees, may take several minutes)
Note:
if a
WindFarmNetworkalready has a solution,MILPRouterwill use it as a warm start.To avoid warm-starting, create a new
WindFarmNetworkand run MILP directly.Set
verbose=Trueto see warm-start messages in the logs (The log messages of the MILP router provide information about warm-start).
[22]:
res_milp = wfn.optimize(router=milp_router)
Using warm start: the model is initialized with the provided solution S.
Starting CP-SAT solver v9.14.6206
Parameters: max_time_in_seconds: 20 log_search_progress: true relative_gap_limit: 0.005
Setting number of workers to 16
Initial optimization model '': (model_fingerprint: 0x8c8bfd2553670828)
#Variables: 1'690 (#bools: 845 in floating point objective) (1'500 primary variables)
- 845 Booleans in [0,1]
- 750 in [0,7]
- 95 in [0,8]
#kAtMostOne: 635 (#literals: 1'926)
#kLinear1: 1'690 (#enforced: 1'690)
#kLinear3: 4
#kLinearN: 284 (#terms: 4'213)
Starting presolve at 0.01s
The solution hint is complete and is feasible.
[Scaling] Floating point objective has 845 terms with magnitude in [1409.66, 22631.9] average = 4594.28
[Scaling] Objective coefficient relative error: 1.60816e-10
[Scaling] Objective worst-case absolute error: 5.3597e-05
[Scaling] Objective scaling factor: 2.09715e+06
6.44e-04s 0.00e+00d [DetectDominanceRelations]
1.53e-02s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
1.18e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ExtractEncodingFromLinear] #potential_supersets=730
4.47e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateColumns]
7.18e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
[Symmetry] Graph for symmetry has 6'328 nodes and 11'931 arcs.
[Symmetry] Symmetry computation done. time: 0.0010796 dtime: 0.00115685
4.13e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
1.39e-02s 3.73e-03d [operations_research::sat::CpModelPresolver::Probe] #probed=1'690
7.75e-04s 3.79e-04d [MaxClique] Merged 635(1'926 literals) into 330(1'316 literals) at_most_ones.
6.37e-04s 0.00e+00d [DetectDominanceRelations]
4.74e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
6.94e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ProcessAtMostOneAndLinear]
8.53e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
5.78e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
7.00e-04s 1.43e-05d [operations_research::sat::CpModelPresolver::DetectDominatedLinearConstraints] #relevant_constraints=193 #num_inclusions=96
6.64e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDifferentVariables]
9.04e-03s 3.72e-04d [operations_research::sat::CpModelPresolver::ProcessSetPPC] #relevant_constraints=427 #num_inclusions=425
1.16e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::FindAlmostIdenticalLinearConstraints]
8.52e-04s 2.83e-04d [operations_research::sat::CpModelPresolver::FindBigAtMostOneAndLinearOverlap]
5.90e-04s 3.25e-04d [operations_research::sat::CpModelPresolver::FindBigVerticalLinearOverlap]
1.05e-04s 1.24e-05d [operations_research::sat::CpModelPresolver::FindBigHorizontalLinearOverlap] #linears=179
4.13e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::MergeClauses]
7.00e-04s 0.00e+00d [DetectDominanceRelations]
9.15e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
5.07e-04s 0.00e+00d [DetectDominanceRelations]
6.08e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
2.67e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateColumns]
4.32e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
[Symmetry] Graph for symmetry has 5'717 nodes and 9'866 arcs.
[Symmetry] Symmetry computation done. time: 0.0015244 dtime: 0.00104489
[SAT presolve] num removable Booleans: 0 / 845
[SAT presolve] num trivial clauses: 0
[SAT presolve] [0s] clauses:70 literals:140 vars:140 one_side_vars:140 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.000574s] clauses:70 literals:140 vars:140 one_side_vars:140 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.0007491s] clauses:70 literals:140 vars:140 one_side_vars:140 simple_definition:0 singleton_clauses:0
3.27e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
1.05e-02s 3.45e-03d [operations_research::sat::CpModelPresolver::Probe] #probed=1'690
5.17e-04s 3.69e-04d [MaxClique]
1.06e-03s 0.00e+00d [DetectDominanceRelations]
5.63e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
8.85e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::ProcessAtMostOneAndLinear]
5.96e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraints]
4.07e-04s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDuplicateConstraintsWithDifferentEnforcements]
6.19e-04s 1.07e-05d [operations_research::sat::CpModelPresolver::DetectDominatedLinearConstraints] #relevant_constraints=192 #num_inclusions=95
5.61e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::DetectDifferentVariables]
3.92e-04s 6.76e-06d [operations_research::sat::CpModelPresolver::ProcessSetPPC] #relevant_constraints=426
8.20e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::FindAlmostIdenticalLinearConstraints]
8.84e-04s 2.79e-04d [operations_research::sat::CpModelPresolver::FindBigAtMostOneAndLinearOverlap]
5.40e-04s 3.25e-04d [operations_research::sat::CpModelPresolver::FindBigVerticalLinearOverlap]
8.56e-05s 1.24e-05d [operations_research::sat::CpModelPresolver::FindBigHorizontalLinearOverlap] #linears=179
4.16e-05s 0.00e+00d [operations_research::sat::CpModelPresolver::MergeClauses]
6.71e-04s 0.00e+00d [DetectDominanceRelations]
6.90e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
1.36e-03s 0.00e+00d [operations_research::sat::CpModelPresolver::ExpandObjective] #entries=7'754 #tight_variables=845 #tight_constraints=95
Presolve summary:
- 0 affine relations were detected.
- rule 'TODO linear inclusion: superset is equality' was applied 191 times.
- rule 'at_most_one: transformed into max clique.' was applied 1 time.
- rule 'deductions: 1690 stored' was applied 1 time.
- rule 'exactly_one: simplified objective' was applied 95 times.
- rule 'linear: positive equal one' was applied 95 times.
- rule 'objective: shifted cost with exactly ones' was applied 95 times.
- rule 'presolve: 0 unused variables removed.' was applied 1 time.
- rule 'presolve: iteration' was applied 2 times.
- rule 'setppc: exactly_one included in linear' was applied 95 times.
- rule 'setppc: reduced linear coefficients' was applied 94 times.
- rule 'setppc: removed trivial linear constraint' was applied 1 time.
- rule 'variables: detect fully reified value encoding' was applied 845 times.
- rule 'variables: detect half reified value encoding' was applied 1'690 times.
Presolved optimization model '': (model_fingerprint: 0x92e17b2da8d8fc2e)
#Variables: 1'690 (#bools: 750 in objective) (1'500 primary variables)
- 845 Booleans in [0,1]
- 750 in [0,7]
- 95 in [0,8]
#kAtMostOne: 260 (#literals: 1'176)
#kBoolAnd: 70 (#enforced: 70) (#literals: 140)
#kExactlyOne: 95 (#literals: 845)
#kLinear1: 1'690 (#enforced: 1'690)
#kLinear3: 4
#kLinearN: 188 (#terms: 2'523)
[Symmetry] Graph for symmetry has 5'717 nodes and 9'866 arcs.
[Symmetry] Symmetry computation done. time: 0.0010637 dtime: 0.00104362
Preloading model.
#Bound 0.13s best:inf next:[160817.074,2309766.32] initial_domain
#1 0.13s best:242931.791 next:[160817.074,242931.791] complete_hint
#Model 0.14s var:1690/1690 constraints:2307/2307
Starting search at 0.14s with 16 workers.
11 full problem subsolvers: [core, default_lp, lb_tree_search, max_lp, no_lp, objective_lb_search, probing, pseudo_costs, quick_restart, quick_restart_no_lp, reduced_costs]
5 first solution subsolvers: [fj(2), fs_random, fs_random_no_lp, fs_random_quick_restart_no_lp]
11 interleaved subsolvers: [feasibility_pump, graph_arc_lns, graph_cst_lns, graph_dec_lns, graph_var_lns, lb_relax_lns, ls, ls_lin, rins/rens, rnd_cst_lns, rnd_var_lns]
3 helper subsolvers: [neighborhood_helper, synchronization_agent, update_gap_integral]
#Bound 0.20s best:242931.791 next:[162472.38,242931.791] am1_presolve (num_literals=750 num_am1=34 increase=3471428032 work_done=2720)
#Bound 0.22s best:242931.791 next:[188354.862,242931.791] default_lp
#Bound 0.22s best:242931.791 next:[189781.728,242931.791] pseudo_costs
#Bound 0.26s best:242931.791 next:[189787.863,242931.791] reduced_costs
#Bound 0.28s best:242931.791 next:[189886.17,242931.791] reduced_costs
#2 0.29s best:242923.237 next:[189886.17,242923.237] quick_restart_no_lp (fixed_bools=0/888)
#Bound 0.30s best:242923.237 next:[223973.897,242923.237] max_lp
#3 0.32s best:242907.625 next:[223973.897,242907.625] quick_restart_no_lp (fixed_bools=0/894)
#4 0.43s best:242499.317 next:[223973.897,242499.317] quick_restart_no_lp (fixed_bools=0/903)
#Bound 0.46s best:242499.317 next:[225385.939,242499.317] max_lp
#5 0.46s best:242498.683 next:[225385.939,242498.683] quick_restart_no_lp (fixed_bools=0/903)
#Bound 0.48s best:242498.683 next:[225492.229,242498.683] lb_tree_search
#6 0.48s best:242063.731 next:[225492.229,242063.731] rins_lp_lns (d=5.00e-01 s=23 t=0.10 p=0.00 stall=0 h=base)
#7 0.49s best:241654.789 next:[225492.229,241654.789] rins_lp_lns (d=5.00e-01 s=23 t=0.10 p=0.00 stall=0 h=base) [combined with: quick_restart_no_lp...]
#Bound 0.64s best:241654.789 next:[226110.959,241654.789] max_lp
#Bound 0.67s best:241654.789 next:[226273.297,241654.789] lb_tree_search
#8 0.85s best:241654.154 next:[226273.297,241654.154] quick_restart_no_lp (fixed_bools=0/933)
#Bound 0.88s best:241654.154 next:[226518.351,241654.154] max_lp
#Bound 0.92s best:241654.154 next:[226563.242,241654.154] lb_tree_search
#9 1.02s best:241477.762 next:[226563.242,241477.762] rins_lp_lns (d=7.07e-01 s=29 t=0.10 p=1.00 stall=0 h=base)
#10 1.03s best:241477.127 next:[226563.242,241477.127] rins_lp_lns (d=7.07e-01 s=29 t=0.10 p=1.00 stall=0 h=base) [combined with: quick_restart_no_lp...]
#11 1.04s best:241101.331 next:[226563.242,241101.331] rnd_var_lns (d=8.14e-01 s=30 t=0.10 p=1.00 stall=2 h=base)
#12 1.05s best:240923.669 next:[226563.242,240923.669] rnd_var_lns (d=8.14e-01 s=30 t=0.10 p=1.00 stall=2 h=base) [combined with: rins_lp_lns (d=7.07e...]
#Bound 1.16s best:240923.669 next:[226957.188,240923.669] lb_tree_search
#Bound 1.18s best:240923.669 next:[226990.815,240923.669] max_lp
#Bound 1.52s best:240923.669 next:[227472.946,240923.669] max_lp
#13 2.08s best:240715.16 next:[227472.946,240715.16] lb_relax_lns_int_h (d=5.00e-01 s=35 t=0.50 p=0.00 stall=0 h=base)
#Bound 2.52s best:240715.16 next:[227789.346,240715.16] max_lp
#Bound 4.40s best:240715.16 next:[228049.802,240715.16] max_lp
#Bound 4.93s best:240715.16 next:[228173.016,240715.16] max_lp
#Bound 6.31s best:240715.16 next:[228326.202,240715.16] max_lp
#Bound 7.79s best:240715.16 next:[228434.497,240715.16] max_lp
#Bound 9.43s best:240715.16 next:[228579.246,240715.16] max_lp
#Bound 11.55s best:240715.16 next:[228611.358,240715.16] lb_tree_search (nodes=16/16 rc=2 decisions=156 @root=3 restarts=0 lp_iters=[0, 0, 3'067, 1'224])
#Bound 14.75s best:240715.16 next:[228643.236,240715.16] max_lp
#Bound 17.51s best:240715.16 next:[228697.398,240715.16] lb_tree_search
#Bound 19.41s best:240715.16 next:[228748.178,240715.16] lb_tree_search
Task timing n [ min, max] avg dev time n [ min, max] avg dev dtime
'core': 1 [ 19.86s, 19.86s] 19.86s 0.00ns 19.86s 1 [ 12.32s, 12.32s] 12.32s 0.00ns 12.32s
'default_lp': 1 [ 19.86s, 19.86s] 19.86s 0.00ns 19.86s 1 [ 3.27s, 3.27s] 3.27s 0.00ns 3.27s
'feasibility_pump': 87 [ 77.00us, 688.72ms] 94.89ms 203.32ms 8.26s 16 [163.16ms, 322.49ms] 229.30ms 42.80ms 3.67s
'fj': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'fj': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'fs_random': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'fs_random_no_lp': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'fs_random_quick_restart_no_lp': 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns 0 [ 0.00ns, 0.00ns] 0.00ns 0.00ns 0.00ns
'graph_arc_lns': 33 [ 21.00ms, 1.20s] 273.48ms 228.71ms 9.02s 33 [ 97.09us, 100.48ms] 57.77ms 44.76ms 1.91s
'graph_cst_lns': 34 [ 12.00ms, 534.33ms] 285.17ms 179.81ms 9.70s 34 [ 10.00ns, 100.25ms] 62.09ms 44.29ms 2.11s
'graph_dec_lns': 34 [ 13.08ms, 959.71ms] 270.27ms 245.18ms 9.19s 34 [ 10.00ns, 100.30ms] 50.71ms 49.38ms 1.72s
'graph_var_lns': 39 [ 17.41ms, 698.12ms] 242.43ms 190.08ms 9.45s 39 [ 10.00ns, 100.23ms] 53.79ms 46.08ms 2.10s
'lb_relax_lns': 7 [680.19ms, 2.02s] 1.28s 509.74ms 8.94s 7 [167.35ms, 557.21ms] 358.76ms 176.91ms 2.51s
'lb_tree_search': 1 [ 19.90s, 19.90s] 19.90s 0.00ns 19.90s 1 [ 2.38s, 2.38s] 2.38s 0.00ns 2.38s
'ls': 40 [184.82ms, 293.91ms] 216.54ms 22.33ms 8.66s 40 [ 68.00ms, 100.02ms] 99.21ms 5.00ms 3.97s
'ls_lin': 41 [177.04ms, 295.13ms] 208.66ms 24.97ms 8.55s 41 [ 94.92ms, 100.05ms] 99.89ms 786.57us 4.10s
'max_lp': 1 [ 19.86s, 19.86s] 19.86s 0.00ns 19.86s 1 [ 3.76s, 3.76s] 3.76s 0.00ns 3.76s
'no_lp': 1 [ 19.90s, 19.90s] 19.90s 0.00ns 19.90s 1 [ 8.76s, 8.76s] 8.76s 0.00ns 8.76s
'objective_lb_search': 1 [ 19.90s, 19.90s] 19.90s 0.00ns 19.90s 1 [ 6.35s, 6.35s] 6.35s 0.00ns 6.35s
'probing': 1 [ 19.90s, 19.90s] 19.90s 0.00ns 19.90s 1 [ 1.42s, 1.42s] 1.42s 0.00ns 1.42s
'pseudo_costs': 1 [ 19.85s, 19.85s] 19.85s 0.00ns 19.85s 1 [ 4.70s, 4.70s] 4.70s 0.00ns 4.70s
'quick_restart': 1 [ 19.90s, 19.90s] 19.90s 0.00ns 19.90s 1 [ 5.44s, 5.44s] 5.44s 0.00ns 5.44s
'quick_restart_no_lp': 1 [ 19.85s, 19.85s] 19.85s 0.00ns 19.85s 1 [ 8.91s, 8.91s] 8.91s 0.00ns 8.91s
'reduced_costs': 1 [ 19.90s, 19.90s] 19.90s 0.00ns 19.90s 1 [ 6.03s, 6.03s] 6.03s 0.00ns 6.03s
'rins/rens': 34 [ 1.50ms, 513.31ms] 259.48ms 199.16ms 8.82s 26 [ 5.61us, 100.20ms] 74.96ms 39.92ms 1.95s
'rnd_cst_lns': 34 [ 17.38ms, 969.74ms] 263.79ms 237.42ms 8.97s 30 [114.00ns, 100.38ms] 53.59ms 45.26ms 1.61s
'rnd_var_lns': 28 [ 24.42ms, 985.05ms] 358.78ms 256.97ms 10.05s 28 [182.00ns, 100.31ms] 63.04ms 42.66ms 1.77s
Search stats Bools Conflicts Branches Restarts BoolPropag IntegerPropag
'core': 879 259'736 565'400 23'197 3'973'876 11'536'604
'default_lp': 929 1'066 12'082 5'156 100'141 410'934
'fs_random': 0 0 0 0 0 0
'fs_random_no_lp': 0 0 0 0 0 0
'fs_random_quick_restart_no_lp': 0 0 0 0 0 0
'lb_tree_search': 845 0 14'984 8'655 63'514 196'282
'max_lp': 845 243 6'058 3'432 35'522 151'875
'no_lp': 845 133'542 318'985 24'846 8'884'105 29'057'923
'objective_lb_search': 885 702 13'177 6'857 76'319 318'571
'probing': 866 10 2'074 1'775 13'686 46'606
'pseudo_costs': 845 1'220 12'775 5'174 97'083 440'561
'quick_restart': 893 117 31'951 17'381 137'496 591'224
'quick_restart_no_lp': 1'227 41'505 922'898 29'430 4'827'624 17'823'688
'reduced_costs': 848 597 33'804 15'622 136'030 671'803
SAT stats ClassicMinim LitRemoved LitLearned LitForgotten Subsumed MClauses MDecisions MLitTrue MSubsumed MLitRemoved MReused
'core': 247'944 2'710'816 17'487'283 15'459'542 2'216 7'771 81'762 0 586 8'933 1'598
'default_lp': 1'015 59'754 155'471 0 2 386 3'018 0 0 0 0
'fs_random': 0 0 0 0 0 0 0 0 0 0 0
'fs_random_no_lp': 0 0 0 0 0 0 0 0 0 0 0
'fs_random_quick_restart_no_lp': 0 0 0 0 0 0 0 0 0 0 0
'lb_tree_search': 0 0 0 0 0 760 6'000 0 0 0 0
'max_lp': 228 12'736 46'020 0 1 190 1'500 0 0 0 0
'no_lp': 127'549 2'432'152 10'682'341 9'384'584 1'178 3'907 40'791 0 247 4'387 677
'objective_lb_search': 677 40'042 29'710 0 0 587 4'637 0 1 13 4
'probing': 10 576 3'086 0 0 0 0 0 0 0 0
'pseudo_costs': 1'138 56'843 161'874 0 4 381 3'003 0 1 4 0
'quick_restart': 107 4'570 11'111 0 0 1'739 13'581 0 5 22 3
'quick_restart_no_lp': 38'365 1'417'459 4'177'244 2'298'883 205 11'919 76'718 0 1'280 12'151 812
'reduced_costs': 556 18'404 99'069 0 0 1'523 12'006 0 0 0 0
Lp stats Component Iterations AddedCuts OPTIMAL DUAL_F. DUAL_U.
'default_lp': 1 63'564 3'188 4'463 0 90
'lb_tree_search': 1 10'923 2'815 252 12 0
'max_lp': 1 26'900 2'788 1'146 47 27
'objective_lb_search': 1 75'624 3'426 2'377 1 24
'probing': 1 9'465 5'806 240 0 1
'pseudo_costs': 1 89'573 2'684 3'525 445 272
'quick_restart': 1 41'791 4'175 1'198 0 6
'reduced_costs': 1 72'547 3'775 2'078 262 108
Lp dimension Final dimension of first component
'default_lp': 888 rows, 1596 columns, 5324 entries
'lb_tree_search': 2228 rows, 1690 columns, 41979 entries
'max_lp': 974 rows, 1690 columns, 11927 entries
'objective_lb_search': 1011 rows, 1596 columns, 8460 entries
'probing': 2646 rows, 1596 columns, 44392 entries
'pseudo_costs': 927 rows, 1690 columns, 5698 entries
'quick_restart': 1358 rows, 1596 columns, 15183 entries
'reduced_costs': 1576 rows, 1690 columns, 16003 entries
Lp debug CutPropag CutEqPropag Adjust Overflow Bad BadScaling
'default_lp': 0 1 4'535 0 5'293 0
'lb_tree_search': 0 0 264 0 55'311 0
'max_lp': 0 0 1'220 0 38'641 0
'objective_lb_search': 0 0 2'391 0 11'340 0
'probing': 0 12 232 0 59'981 0
'pseudo_costs': 0 0 4'173 0 4'642 0
'quick_restart': 0 0 1'195 0 24'046 0
'reduced_costs': 0 0 2'429 0 15'983 0
Lp pool Constraints Updates Simplif Merged Shortened Split Strenghtened Cuts/Call
'default_lp': 5'988 18 0 0 0 13 85 3'188/7'494
'lb_tree_search': 5'967 524 0 0 0 903 39 2'815/5'225
'max_lp': 5'940 342 0 0 0 604 23 2'788/5'311
'objective_lb_search': 6'226 75 0 0 0 18 113 3'426/7'190
'probing': 8'606 427 0 0 0 424 188 5'806/11'667
'pseudo_costs': 5'836 24 0 0 0 12 45 2'684/5'842
'quick_restart': 6'975 249 0 0 0 193 126 4'175/8'271
'reduced_costs': 6'927 160 0 0 0 97 88 3'775/7'376
Lp Cut default_lp max_lp pseudo_costs quick_restart reduced_costs lb_tree_search probing objective_lb_search
CG_FF: 32 8 26 29 33 5 33 33
CG_K: 17 5 13 16 11 1 21 20
CG_KL: 4 - 3 4 3 - 5 5
CG_R: 51 33 33 50 47 21 84 43
CG_RB: 91 66 70 103 113 53 142 92
CG_RBP: 47 19 21 47 25 8 74 52
IB: 1'245 198 1'292 968 1'145 1 738 910
MIR_1_FF: 139 135 55 227 129 147 354 177
MIR_1_K: 48 5 17 70 22 1 94 56
MIR_1_KL: 25 - 7 34 9 - 44 21
MIR_1_R: 1 - 1 3 - - 12 1
MIR_1_RB: 79 40 30 121 65 57 225 98
MIR_1_RBP: 41 9 11 89 21 13 188 70
MIR_2_FF: 131 168 80 230 158 202 356 141
MIR_2_K: 70 9 23 85 35 11 104 76
MIR_2_KL: 22 - 11 23 12 5 27 22
MIR_2_R: 7 4 7 15 9 8 22 9
MIR_2_RB: 101 162 86 162 162 188 279 143
MIR_2_RBP: 47 33 25 103 52 35 203 99
MIR_3_FF: 102 193 76 149 160 206 227 117
MIR_3_K: 58 28 27 80 41 20 126 77
MIR_3_KL: 12 - 9 12 16 1 18 9
MIR_3_R: 8 8 12 10 18 9 12 10
MIR_3_RB: 99 185 92 137 168 200 187 102
MIR_3_RBP: 48 53 18 97 46 60 166 82
MIR_4_FF: 54 148 45 92 129 171 142 77
MIR_4_K: 45 43 26 59 38 35 75 51
MIR_4_KL: 3 - 5 5 5 2 8 6
MIR_4_R: 6 12 8 8 11 5 10 7
MIR_4_RB: 60 139 72 85 140 140 111 74
MIR_4_RBP: 27 57 17 75 40 64 78 32
MIR_5_FF: 35 118 20 53 82 120 100 38
MIR_5_K: 24 32 15 36 23 35 87 45
MIR_5_KL: 2 1 3 3 1 6 11 5
MIR_5_R: 3 11 6 6 7 10 8 6
MIR_5_RB: 31 92 44 41 92 85 64 36
MIR_5_RBP: 9 37 8 48 24 41 86 28
MIR_6_FF: 14 71 26 35 56 79 43 40
MIR_6_K: 17 28 17 30 15 26 48 30
MIR_6_KL: 3 21 11 7 22 22 16 4
MIR_6_R: - 7 7 3 2 8 4 4
MIR_6_RB: 15 48 31 17 47 48 27 23
MIR_6_RBP: 6 41 17 28 31 44 63 23
ZERO_HALF_FF: 39 8 21 48 45 7 21 40
ZERO_HALF_K: 12 2 11 12 5 - 16 11
ZERO_HALF_KL: 3 - 3 4 1 - 1 3
ZERO_HALF_R: 198 435 184 473 358 512 830 280
ZERO_HALF_RB: 42 64 29 108 76 89 137 65
ZERO_HALF_RBP: 15 12 13 35 25 14 79 33
LNS stats Improv/Calls Closed Difficulty TimeLimit
'graph_arc_lns': 3/33 48% 3.43e-01 0.10
'graph_cst_lns': 5/34 50% 6.58e-01 0.10
'graph_dec_lns': 5/34 50% 7.14e-01 0.10
'graph_var_lns': 4/39 49% 6.05e-01 0.10
'lb_relax_lns': 3/7 43% 3.48e-01 0.50
'rins/rens': 31/33 45% 3.75e-01 0.10
'rnd_cst_lns': 2/30 53% 7.65e-01 0.10
'rnd_var_lns': 4/28 54% 8.10e-01 0.10
LS stats Batches Restarts/Perturbs LinMoves GenMoves CompoundMoves Bactracks WeightUpdates ScoreComputed
'ls_lin_restart': 10 5 124'692 0 0 0 23'072 4'912'338
'ls_lin_restart_compound': 7 7 0 112'485 8'739 51'864 844 3'206'204
'ls_lin_restart_compound_perturb': 5 5 0 73'611 6'892 33'349 507 2'152'883
'ls_lin_restart_decay': 5 3 77'347 0 0 0 1'249 1'765'993
'ls_lin_restart_decay_compound_perturb': 4 3 0 53'495 8'782 22'353 93 1'557'018
'ls_lin_restart_decay_perturb': 6 4 93'542 0 0 0 1'500 2'157'277
'ls_lin_restart_perturb': 4 4 52'694 0 0 0 7'860 1'924'036
'ls_restart': 3 2 38'881 0 0 0 5'923 1'413'726
'ls_restart_compound': 9 6 0 145'891 14'046 65'906 675 4'148'495
'ls_restart_compound_perturb': 5 5 0 83'847 7'673 38'082 563 2'249'684
'ls_restart_decay': 3 3 46'555 0 0 0 784 1'060'799
'ls_restart_decay_compound': 6 4 0 75'154 12'297 31'415 136 2'602'984
'ls_restart_decay_compound_perturb': 5 3 0 61'529 10'198 25'660 110 1'832'280
'ls_restart_decay_perturb': 7 6 108'030 0 0 0 1'878 2'430'435
'ls_restart_perturb': 2 2 26'046 0 0 0 4'833 936'592
Solutions (13) Num Rank
'complete_hint': 1 [1,1]
'lb_relax_lns_int_h': 1 [13,13]
'quick_restart_no_lp': 5 [2,8]
'rins_lp_lns': 4 [6,10]
'rnd_var_lns': 2 [11,12]
Objective bounds Num
'am1_presolve': 1
'default_lp': 1
'initial_domain': 1
'lb_tree_search': 7
'max_lp': 13
'pseudo_costs': 1
'reduced_costs': 2
Solution repositories Added Queried Synchro
'feasible solutions': 73 570 48
'fj solution hints': 0 0 0
'lp solutions': 124 20 103
'pump': 321 14
[Scaling] scaled_objective_bound: 228748 corrected_bound: 228748 delta: -1.01302e-06
CpSolverResponse summary:
status: FEASIBLE
objective: 240715.1599014539
best_bound: 228748.1782036421
integers: 0
booleans: 0
conflicts: 0
branches: 0
propagations: 0
integer_propagations: 0
restarts: 0
lp_iterations: 0
walltime: 20.158
usertime: 20.158
deterministic_time: 90.7637
gap_integral: 853.326
solution_fingerprint: 0x91194cc2586fc39b
[23]:
wfn.solution_info()
[23]:
{'router': 'MILPRouter',
'capacity': 8,
'solver_name': 'ortools',
'topology': <Topology.BRANCHED: 'branched'>,
'feeder_route': <FeederRoute.SEGMENTED: 'segmented'>,
'feeder_limit': <FeederLimit.UNLIMITED: 'unlimited'>,
'max_feeders': 0,
'runtime': 20.1580118,
'bound': 228748.1782036421,
'objective': 240715.1599014539,
'relgap': 0.0497142834822325,
'termination': 'FEASIBLE'}
[24]:
wfn.length()
[24]:
240866.20757545892
[25]:
wfn
[25]: