mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-06 16:38:51 -06:00
Reformat source code
This commit is contained in:
@@ -8,11 +8,11 @@ using SCIP
|
||||
function test_problems_stab()
|
||||
nx = pyimport("networkx")
|
||||
data = MaxWeightStableSetData(
|
||||
graph=nx.gnp_random_graph(25, 0.5, seed=42),
|
||||
weights=repeat([1.0], 25),
|
||||
graph = nx.gnp_random_graph(25, 0.5, seed = 42),
|
||||
weights = repeat([1.0], 25),
|
||||
)
|
||||
h5 = H5File(tempname(), "w")
|
||||
model = build_stab_model_jump(data, optimizer=SCIP.Optimizer)
|
||||
model = build_stab_model_jump(data, optimizer = SCIP.Optimizer)
|
||||
model.extract_after_load(h5)
|
||||
model.optimize()
|
||||
model.extract_after_mip(h5)
|
||||
|
||||
@@ -10,17 +10,12 @@ function test_problems_tsp()
|
||||
squareform = pyimport("scipy.spatial.distance").squareform
|
||||
|
||||
data = TravelingSalesmanData(
|
||||
n_cities=6,
|
||||
distances=squareform(pdist([
|
||||
[0.0, 0.0],
|
||||
[1.0, 0.0],
|
||||
[2.0, 0.0],
|
||||
[3.0, 0.0],
|
||||
[0.0, 1.0],
|
||||
[3.0, 1.0],
|
||||
])),
|
||||
n_cities = 6,
|
||||
distances = squareform(
|
||||
pdist([[0.0, 0.0], [1.0, 0.0], [2.0, 0.0], [3.0, 0.0], [0.0, 1.0], [3.0, 1.0]]),
|
||||
),
|
||||
)
|
||||
model = build_tsp_model_jump(data, optimizer=GLPK.Optimizer)
|
||||
model = build_tsp_model_jump(data, optimizer = GLPK.Optimizer)
|
||||
model.optimize()
|
||||
@test objective_value(model.inner) == 8.0
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user