Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francois Hamonic
landscape_opt_networks_submission
Commits
cf63f2a0
Commit
cf63f2a0
authored
Mar 30, 2022
by
Francois Hamonic
Browse files
ok
parent
62835d4d
Changes
10
Hide whitespace changes
Inline
Side-by-side
exec/execution_times/aude.cpp
View file @
cf63f2a0
...
...
@@ -21,14 +21,14 @@ double eval(T && ls) {
int
main
()
{
std
::
ofstream
data_log
(
"output/time_aude.csv"
);
data_log
<<
std
::
fixed
<<
std
::
setprecision
(
6
);
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_
eca_
2_ECA,pl_"
"
eca_
2_obj,pl_
eca_
2_variables,pl_2_constraints,pl_2_entries,pl_"
"
2_time,pl_eca
_3_ECA,pl_
eca_
3_obj,pl_
eca_
3_variables,pl_3_"
"
constraints,pl_3_
entries,pl_3_preprocessing_time,pl_3_time"
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_2_ECA,pl_
eca_
"
"2_obj,pl_2_variables,pl_2_constraints,pl_2_entries,pl_
2_time,
"
"
pl
_3_ECA,pl_3_obj,pl_3_variables,pl_3_
constraints,pl_3_
"
"entries,pl_3_preprocessing_time,pl_3_time"
<<
std
::
endl
;
std
::
vector
<
double
>
budget_values
;
for
(
int
i
=
0
;
i
<=
15
;
++
i
)
budget_values
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
15
;
++
i
)
budget_values
.
push_back
(
i
);
Solvers
::
PL_ECA_2
pl_eca_2
;
pl_eca_2
.
setTimeout
(
36000
).
setLogLevel
(
2
);
...
...
@@ -58,7 +58,7 @@ int main() {
std
::
cout
<<
"plan total cost:"
<<
plan
.
totalCost
()
<<
std
::
endl
;
// Helper::printInstanceGraphviz(landscape, plan, "aude.dot");
// Helper::printInstance(landscape, plan, "aude.eps");
for
(
double
B
:
budget_values
)
{
const
double
base_ECA
=
eval
(
landscape
);
const
double
restored_ECA
=
...
...
@@ -73,9 +73,9 @@ int main() {
const
double
pl_3_ECA
=
eval
(
Helper
::
decore_landscape
(
landscape
,
plan
,
pl_3_solution
));
data_log
<<
B
<<
','
<<
B
/
plan
.
totalCost
()
*
100
<<
','
<<
base_ECA
<<
','
<<
max_delta_ECA
<<
','
<<
pl_2_ECA
<<
','
<<
pl_2_solution
.
obj
<<
','
<<
pl_2_solution
.
nb_vars
<<
','
data_log
<<
B
<<
','
<<
B
/
plan
.
totalCost
()
*
100
<<
','
<<
base_ECA
<<
','
<<
max_delta_ECA
<<
','
<<
pl_2_ECA
<<
','
<<
pl_2_solution
.
obj
<<
','
<<
pl_2_solution
.
nb_vars
<<
','
<<
pl_2_solution
.
nb_constraints
<<
','
<<
pl_2_solution
.
nb_elems
<<
','
<<
pl_2_solution
.
getComputeTimeMs
()
<<
','
<<
pl_3_ECA
<<
','
...
...
exec/execution_times/biorevaix.cpp
View file @
cf63f2a0
...
...
@@ -84,14 +84,14 @@ Instance make_instance(const double dist_coef, const double restoration_coef) {
int
main
()
{
std
::
ofstream
data_log
(
"output/time_biorevaix.csv"
);
data_log
<<
std
::
fixed
<<
std
::
setprecision
(
6
);
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_
eca_
2_ECA,pl_"
"
eca_
2_obj,pl_
eca_
2_variables,pl_2_constraints,pl_2_entries,pl_"
"
2_time,pl_eca
_3_ECA,pl_
eca_
3_obj,pl_
eca_
3_variables,pl_3_"
"
constraints,pl_3_
entries,pl_3_preprocessing_time,pl_3_time"
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_2_ECA,pl_
eca_
"
"2_obj,pl_2_variables,pl_2_constraints,pl_2_entries,pl_
2_time,
"
"
pl
_3_ECA,pl_3_obj,pl_3_variables,pl_3_
constraints,pl_3_
"
"entries,pl_3_preprocessing_time,pl_3_time"
<<
std
::
endl
;
std
::
vector
<
double
>
budget_percents
;
for
(
int
i
=
1
7
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
Solvers
::
PL_ECA_2
pl_eca_2
;
pl_eca_2
.
setTimeout
(
36000
).
setLogLevel
(
2
);
...
...
exec/execution_times/marseille.cpp
View file @
cf63f2a0
...
...
@@ -21,14 +21,14 @@ double eval(T && ls) {
int
main
()
{
std
::
ofstream
data_log
(
"output/time_marseille.csv"
);
data_log
<<
std
::
fixed
<<
std
::
setprecision
(
6
);
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_
eca_
2_ECA,pl_"
"
eca_
2_obj,pl_
eca_
2_variables,pl_2_constraints,pl_2_entries,pl_"
"
2_time,pl_eca
_3_ECA,pl_
eca_
3_obj,pl_
eca_
3_variables,pl_3_"
"
constraints,pl_3_
entries,pl_3_preprocessing_time,pl_3_time"
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_2_ECA,pl_
eca_
"
"2_obj,pl_2_variables,pl_2_constraints,pl_2_entries,pl_
2_time,
"
"
pl
_3_ECA,pl_3_obj,pl_3_variables,pl_3_
constraints,pl_3_
"
"entries,pl_3_preprocessing_time,pl_3_time"
<<
std
::
endl
;
std
::
vector
<
double
>
budget_percents
;
for
(
int
i
=
0
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
Solvers
::
PL_ECA_2
pl_eca_2
;
pl_eca_2
.
setTimeout
(
36000
).
setLogLevel
(
2
);
...
...
@@ -41,8 +41,7 @@ int main() {
const
MutableLandscape
&
landscape
=
instance
.
landscape
;
const
RestorationPlan
<
MutableLandscape
>
&
plan
=
instance
.
plan
;
for
(
double
budget_percent
:
budget_percents
)
{
for
(
double
budget_percent
:
budget_percents
)
{
const
double
B
=
plan
.
totalCost
()
*
budget_percent
/
100
;
const
double
base_ECA
=
eval
(
landscape
);
...
...
@@ -72,61 +71,4 @@ int main() {
}
return
EXIT_SUCCESS
;
}
// #include <filesystem>
// #include <fstream>
// #include <iostream>
// #include "indices/eca.hpp"
// #include "landscape/decored_landscape.hpp"
// #include "solvers/bogo.hpp"
// #include "solvers/glutton_eca_dec.hpp"
// #include "solvers/glutton_eca_inc.hpp"
// #include "solvers/pl_eca_3.hpp"
// #include "helper.hpp"
// #include "instances_helper.hpp"
// int main() {
// std::ofstream data_log("output/marseille_analysis.csv");
// data_log << std::fixed << std::setprecision(6);
// data_log << "median_dist,90_eca_node_cover,90_eca_node_cover_restored,"
// "base_ECA,delta_ECA"
// << std::endl;
// std::vector<double> median_dists{500, 1000, 1500, 2000, 2500,
// 3000, 3500, 4000, 5000};
// const ECA & eca = ECA();
// for(double median : median_dists) {
// const Instance instance = make_instance_marseille(1, 0, median, 100);
// const MutableLandscape & landscape = instance.landscape;
// const RestorationPlan<MutableLandscape> & plan = instance.plan;
// // Helper::assert_well_formed(landscape, plan);
// // Helper::printInstanceGraphviz(landscape, plan,
// // "marseille.dot");
// auto restored_landscape = Helper::decore_landscape(landscape, plan);
// const double eca_90_node_cover =
// Helper::averageRatioOfNodesInECARealization(0.90, landscape);
// const double eca_90_node_cover_restored =
// Helper::averageRatioOfNodesInECARealization(0.90,
// restored_landscape);
// const double base_ECA = ECA().eval(landscape);
// const double restored_ECA = ECA().eval(restored_landscape);
// const double delta_ECA = restored_ECA - base_ECA;
// data_log << median << ',' << eca_90_node_cover * 100 << ','
// << eca_90_node_cover_restored * 100 << ',' << base_ECA <<
// ','
// << delta_ECA << std::endl;
// }
// return EXIT_SUCCESS;
// }
\ No newline at end of file
}
\ No newline at end of file
exec/execution_times/quebec.cpp
View file @
cf63f2a0
...
...
@@ -21,14 +21,14 @@ double eval(T && ls) {
int
main
()
{
std
::
ofstream
data_log
(
"output/time_quebec.csv"
);
data_log
<<
std
::
fixed
<<
std
::
setprecision
(
6
);
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_
eca_
2_ECA,pl_"
"
eca_
2_obj,pl_
eca_
2_variables,pl_2_constraints,pl_2_entries,pl_"
"
2_time,pl_eca
_3_ECA,pl_
eca_
3_obj,pl_
eca_
3_variables,pl_3_"
"
constraints,pl_3_
entries,pl_3_preprocessing_time,pl_3_time"
data_log
<<
"budget,budget_percent,base_ECA,max_delta_ECA,pl_2_ECA,pl_
eca_
"
"2_obj,pl_2_variables,pl_2_constraints,pl_2_entries,pl_
2_time,
"
"
pl
_3_ECA,pl_3_obj,pl_3_variables,pl_3_
constraints,pl_3_
"
"entries,pl_3_preprocessing_time,pl_3_time"
<<
std
::
endl
;
std
::
vector
<
double
>
budget_percents
;
for
(
int
i
=
3
1
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
Solvers
::
PL_ECA_2
pl_eca_2
;
pl_eca_2
.
setTimeout
(
36000
).
setLogLevel
(
2
);
...
...
@@ -54,8 +54,7 @@ int main() {
// Helper::printInstanceGraphviz(landscape, plan, "quebec.dot");
// Helper::printInstance(landscape, plan, "quebec.eps");
for
(
double
budget_percent
:
budget_percents
)
{
for
(
double
budget_percent
:
budget_percents
)
{
const
double
B
=
plan
.
totalCost
()
*
budget_percent
/
100
;
const
double
base_ECA
=
eval
(
landscape
);
...
...
@@ -85,65 +84,4 @@ int main() {
}
return
EXIT_SUCCESS
;
}
// #include <filesystem>
// #include <fstream>
// #include <iostream>
// #include "indices/eca.hpp"
// #include "landscape/decored_landscape.hpp"
// #include "solvers/bogo.hpp"
// #include "solvers/glutton_eca_dec.hpp"
// #include "solvers/glutton_eca_inc.hpp"
// #include "solvers/pl_eca_3.hpp"
// #include "helper.hpp"
// #include "instances_helper.hpp"
// #include "print_helper.hpp"
// int main() {
// std::ofstream data_log("output/quebec_analysis.csv");
// data_log << std::fixed << std::setprecision(6);
// data_log <<
// "median_dist,90_eca_node_cover,90_eca_node_cover_restored,base_"
// "ECA,delta_ECA"
// << std::endl;
// std::vector<double> median_dists{1000, 1500, 2000, 2500, 3000, 3500};
// std::vector<double> decreased_probs{0};
// const ECA & eca = ECA();
// for(double median : median_dists) {
// Instance instance = make_instance_quebec_frog(1, 0, median);
// const MutableLandscape & landscape = instance.landscape;
// const RestorationPlan<MutableLandscape> & plan = instance.plan;
// std::cout << lemon::countNodes(landscape.getNetwork()) << std::endl;
// Helper::assert_well_formed(landscape, plan);
// Helper::printInstanceGraphviz(landscape, plan, "quebec.dot");
// auto restored_landscape = Helper::decore_landscape(landscape, plan);
// const double eca_90_node_cover =
// Helper::averageRatioOfNodesInECARealization(0.90, landscape);
// const double eca_90_node_cover_restored =
// Helper::averageRatioOfNodesInECARealization(0.90,
// restored_landscape);
// const double base_ECA = ECA().eval(landscape);
// const double restored_ECA =
// ECA().eval(Helper::decore_landscape(landscape, plan));
// const double delta_ECA = restored_ECA - base_ECA;
// data_log << median << ',' << eca_90_node_cover * 100 << ','
// << eca_90_node_cover_restored * 100 << ',' << base_ECA <<
// ','
// << delta_ECA << std::endl;
// }
// return EXIT_SUCCESS;
// }
\ No newline at end of file
}
\ No newline at end of file
exec/quality_of_solutions/aude.cpp
View file @
cf63f2a0
...
...
@@ -33,7 +33,7 @@ int main() {
<<
std
::
endl
;
std
::
vector
<
double
>
budget_values
;
for
(
int
i
=
0
;
i
<=
15
;
++
i
)
budget_values
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
15
;
++
i
)
budget_values
.
push_back
(
i
);
Solvers
::
Bogo
bogo
;
bogo
.
setSeed
(
299792458
);
...
...
exec/quality_of_solutions/biorevaix.cpp
View file @
cf63f2a0
...
...
@@ -26,7 +26,8 @@ Instance make_instance(const double dist_coef, const double restoration_coef) {
Instance
raw_instance
=
make_instance_biorevaix
(
restoration_coef
,
dist_coef
);
Helper
::
printInstanceGraphviz
(
raw_instance
.
landscape
,
raw_instance
.
plan
,
"biorevaix_raw.dot"
);
Helper
::
printInstanceGraphviz
(
raw_instance
.
landscape
,
raw_instance
.
plan
,
"biorevaix_raw.dot"
);
Instance
instance
=
trivial_reformulate
(
std
::
move
(
raw_instance
));
...
...
@@ -41,7 +42,8 @@ Instance make_instance(const double dist_coef, const double restoration_coef) {
// << std::endl;
// int count = 0;
// for(MutableLandscape::NodeIt u(landscape.getNetwork()); u != lemon::INVALID;
// for(MutableLandscape::NodeIt u(landscape.getNetwork()); u !=
// lemon::INVALID;
// ++u)
// count += (landscape.getQuality(u) > 0 ? 1 : 0);
// std::cout << "nb nodes positive quality:" << count << std::endl;
...
...
@@ -65,7 +67,6 @@ Instance make_instance(const double dist_coef, const double restoration_coef) {
}
}
std
::
cout
<<
"nb nodes:"
<<
lemon
::
countNodes
(
landscape
.
getNetwork
())
<<
std
::
endl
;
std
::
cout
<<
"nb arcs:"
<<
lemon
::
countArcs
(
landscape
.
getNetwork
())
...
...
@@ -95,7 +96,7 @@ int main() {
<<
std
::
endl
;
std
::
vector
<
double
>
budget_percents
;
for
(
int
i
=
0
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
Solvers
::
Bogo
bogo
;
bogo
.
setSeed
(
299792458
);
...
...
exec/quality_of_solutions/marseille.cpp
View file @
cf63f2a0
...
...
@@ -32,7 +32,7 @@ int main() {
<<
std
::
endl
;
std
::
vector
<
double
>
budget_percents
;
for
(
int
i
=
0
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
for
(
int
i
=
1
;
i
<=
40
;
++
i
)
budget_percents
.
push_back
(
i
);
Solvers
::
Bogo
bogo
;
bogo
.
setSeed
(
299792458
);
...
...
@@ -113,61 +113,4 @@ int main() {
}
return
EXIT_SUCCESS
;
}
// #include <filesystem>
// #include <fstream>
// #include <iostream>
// #include "indices/eca.hpp"
// #include "landscape/decored_landscape.hpp"
// #include "solvers/bogo.hpp"
// #include "solvers/glutton_eca_dec.hpp"
// #include "solvers/glutton_eca_inc.hpp"
// #include "solvers/pl_eca_3.hpp"
// #include "helper.hpp"
// #include "instances_helper.hpp"
// int main() {
// std::ofstream data_log("output/marseille_analysis.csv");
// data_log << std::fixed << std::setprecision(6);
// data_log << "median_dist,90_eca_node_cover,90_eca_node_cover_restored,"
// "base_ECA,delta_ECA"
// << std::endl;
// std::vector<double> median_dists{500, 1000, 1500, 2000, 2500,
// 3000, 3500, 4000, 5000};
// const ECA & eca = ECA();
// for(double median : median_dists) {
// const Instance instance = make_instance_marseille(1, 0, median, 100);
// const MutableLandscape & landscape = instance.landscape;
// const RestorationPlan<MutableLandscape> & plan = instance.plan;
// // Helper::assert_well_formed(landscape, plan);
// // Helper::printInstanceGraphviz(landscape, plan,
// // "marseille.dot");
// auto restored_landscape = Helper::decore_landscape(landscape, plan);
// const double eca_90_node_cover =
// Helper::averageRatioOfNodesInECARealization(0.90, landscape);
// const double eca_90_node_cover_restored =
// Helper::averageRatioOfNodesInECARealization(0.90,
// restored_landscape);
// const double base_ECA = ECA().eval(landscape);
// const double restored_ECA = ECA().eval(restored_landscape);
// const double delta_ECA = restored_ECA - base_ECA;
// data_log << median << ',' << eca_90_node_cover * 100 << ','
// << eca_90_node_cover_restored * 100 << ',' << base_ECA <<
// ','
// << delta_ECA << std::endl;
// }
// return EXIT_SUCCESS;
// }
\ No newline at end of file
}
\ No newline at end of file
exec/quality_of_solutions/quebec.cpp
View file @
cf63f2a0
...
...
@@ -124,65 +124,4 @@ int main() {
}
return
EXIT_SUCCESS
;
}
// #include <filesystem>
// #include <fstream>
// #include <iostream>
// #include "indices/eca.hpp"
// #include "landscape/decored_landscape.hpp"
// #include "solvers/bogo.hpp"
// #include "solvers/glutton_eca_dec.hpp"
// #include "solvers/glutton_eca_inc.hpp"
// #include "solvers/pl_eca_3.hpp"
// #include "helper.hpp"
// #include "instances_helper.hpp"
// #include "print_helper.hpp"
// int main() {
// std::ofstream data_log("output/quebec_analysis.csv");
// data_log << std::fixed << std::setprecision(6);
// data_log <<
// "median_dist,90_eca_node_cover,90_eca_node_cover_restored,base_"
// "ECA,delta_ECA"
// << std::endl;
// std::vector<double> median_dists{1000, 1500, 2000, 2500, 3000, 3500};
// std::vector<double> decreased_probs{0};
// const ECA & eca = ECA();
// for(double median : median_dists) {
// Instance instance = make_instance_quebec_frog(1, 0, median);
// const MutableLandscape & landscape = instance.landscape;
// const RestorationPlan<MutableLandscape> & plan = instance.plan;
// std::cout << lemon::countNodes(landscape.getNetwork()) << std::endl;
// Helper::assert_well_formed(landscape, plan);
// Helper::printInstanceGraphviz(landscape, plan, "quebec.dot");
// auto restored_landscape = Helper::decore_landscape(landscape, plan);
// const double eca_90_node_cover =
// Helper::averageRatioOfNodesInECARealization(0.90, landscape);
// const double eca_90_node_cover_restored =
// Helper::averageRatioOfNodesInECARealization(0.90,
// restored_landscape);
// const double base_ECA = ECA().eval(landscape);
// const double restored_ECA =
// ECA().eval(Helper::decore_landscape(landscape, plan));
// const double delta_ECA = restored_ECA - base_ECA;
// data_log << median << ',' << eca_90_node_cover * 100 << ','
// << eca_90_node_cover_restored * 100 << ',' << base_ECA <<
// ','
// << delta_ECA << std::endl;
// }
// return EXIT_SUCCESS;
// }
\ No newline at end of file
}
\ No newline at end of file
pl_eca_3.lp
View file @
cf63f2a0
...
...
@@ -173031,7 +173031,7 @@ R0167152: 252 y_0 + 801 y_1 + 1080 y_2 + 54 y_3 + 630 y_4 + 288 y_5 + 24624 y_6
+ 369 y_230 + 261 y_231 + 414 y_232 + 747 y_233 + 981 y_234 + 1125 y_235 + 198 y_236 + 450 y_237 + 1026 y_238 + 900 y_239
+ 1359 y_240 + 2808 y_241 + 1161 y_242 + 351 y_243 + 180 y_244 + 387 y_245 + 2052 y_246 + 432 y_247 + 1386 y_248 + 1746 y_249
+ 1098 y_250 + 279 y_251 + 504 y_252 + 7767 y_253 + 927 y_254 + 549 y_255 + 477 y_256 + 351 y_257 + 198 y_258 + 477 y_259
<=
8533.08
000
<=
4266.54
000
R0167152_low: 252 y_0 + 801 y_1 + 1080 y_2 + 54 y_3 + 630 y_4 + 288 y_5 + 24624 y_6 + 18 y_7 + 2142 y_8 + 63 y_9
+ 81 y_10 + 990 y_11 + 1323 y_12 + 3753 y_13 + 63 y_14 + 369 y_15 + 360 y_16 + 414 y_17 + 261 y_18 + 90 y_19
+ 162 y_20 + 738 y_21 + 1584 y_22 + 9 y_23 + 45 y_24 + 90 y_25 + 1485 y_26 + 657 y_27 + 162 y_28 + 342 y_29
plot_scripts/optimum_ratios_tiled.py
View file @
cf63f2a0
...
...
@@ -50,5 +50,5 @@ fig.set_size_inches(8,6)
plt
.
rcParams
.
update
({
'font.size'
:
18
})
# plt.tight_layout()
plt
.
savefig
(
"
figures
/optimum_ratios.pdf"
,
dpi
=
500
)
plt
.
savefig
(
"
output
/optimum_ratios.pdf"
,
dpi
=
500
)
# plt.show()
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment