mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Docs: Add TSP
This commit is contained in:
@@ -20,6 +20,8 @@ To illustrate the performance of `LearningSolver`, and to set a baseline for new
|
||||
|
||||
All experiments presented here were performed on a Linux server (Ubuntu Linux 18.04 LTS) with Intel Xeon Gold 6230s (2 processors, 40 cores, 80 threads) and 256 GB RAM (DDR4, 2933 MHz). All solvers were restricted to use 4 threads, with no time limits, and 10 instances were solved simultaneously at a time.
|
||||
|
||||
|
||||
|
||||
## Maximum Weight Stable Set Problem
|
||||
|
||||
### Problem definition
|
||||
@@ -45,6 +47,8 @@ MaxWeightStableSetGenerator(w=uniform(loc=100., scale=50.),
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## Multidimensional 0-1 Knapsack Problem
|
||||
|
||||
### Problem definition
|
||||
@@ -115,3 +119,31 @@ MultiKnapsackGenerator(n=randint(low=250, high=251),
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## Traveling Salesman Problem
|
||||
|
||||
### Problem definition
|
||||
|
||||
Given a list of cities and the distance between each pair of cities, the problem asks for the
|
||||
shortest route starting at the first city, visiting each other city exactly once, then returning
|
||||
to the first city. This problem is a generalization of the Hamiltonian path problem, one of Karp's
|
||||
21 NP-complete problems.
|
||||
|
||||
### Random problem generator
|
||||
|
||||
The class `TravelingSalesmanGenerator` can be used to generate random instances of this
|
||||
problem. Initially, the generator creates $n$ cities $(x_1,y_1),\ldots,(x_n,y_n) \in \mathbb{R}^2$,
|
||||
where $n, x_i$ and $y_i$ are sampled independently from the provided probability distributions `n`,
|
||||
`x` and `y`. For each pair of cities $(i,j)$, the distance $d_{i,j}$ between them is set to:
|
||||
$$
|
||||
d_{i,j} = \gamma_{i,j} \sqrt{(x_i-x_j)^2 + (y_i - y_j)^2}
|
||||
$$
|
||||
where $\gamma_{i,j}$ is sampled from the distribution `gamma`.
|
||||
|
||||
If `fix_cities=True` is provided, the list of cities is kept the same for all generated instances.
|
||||
The $gamma$ values, and therefore also the distances, are still different.
|
||||
|
||||
By default, all distances $d_{i,j}$ are rounded to the nearest integer. If `round=False`
|
||||
is provided, this rounding will be disabled.
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<title>MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="/css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="/css/base.min.css" rel="stylesheet">
|
||||
<link href="/css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="/css/highlight.min.css" rel="stylesheet">
|
||||
<link href="/css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -151,7 +149,8 @@
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="/js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="/js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = "/"</script>
|
||||
|
||||
<script src="/js/base.js"></script>
|
||||
@@ -163,11 +162,8 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<title>About - MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/base.min.css" rel="stylesheet">
|
||||
<link href="../css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="../css/highlight.min.css" rel="stylesheet">
|
||||
<link href="../css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -209,7 +207,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="../js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="../js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = ".."</script>
|
||||
|
||||
<script src="../js/base.js"></script>
|
||||
@@ -221,11 +220,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<title>Benchmark - MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/base.min.css" rel="stylesheet">
|
||||
<link href="../css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="../css/highlight.min.css" rel="stylesheet">
|
||||
<link href="../css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -218,7 +216,8 @@ benchmark.parallel_solve(test_instances)
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="../js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="../js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = ".."</script>
|
||||
|
||||
<script src="../js/base.js"></script>
|
||||
@@ -230,11 +229,8 @@ benchmark.parallel_solve(test_instances)
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
||||
@@ -10,28 +10,23 @@ body {
|
||||
color: #343838;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family:'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-family:'PT Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
color: #222;
|
||||
}
|
||||
h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small {
|
||||
color: #B1B7B9;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
h1, h2 {
|
||||
font-weight: 700;
|
||||
}
|
||||
h4 {
|
||||
font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
margin-top: 20px;
|
||||
font-style: italic;
|
||||
}
|
||||
h5 {
|
||||
font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
@@ -46,7 +41,7 @@ pre {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.lead {
|
||||
font-family:"Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
letter-spacing: 0.0312em;
|
||||
@@ -59,8 +54,7 @@ pre {
|
||||
.bs-sidenav {
|
||||
background-image: url("../img/grid11.png");
|
||||
background-repeat: repeat;
|
||||
font-family: Inter,"Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
font-size: 13px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.well {
|
||||
background-color: #FCFDFF;
|
||||
@@ -77,7 +71,7 @@ pre {
|
||||
box-shadow: none;
|
||||
}
|
||||
#mkdocs-search-query {
|
||||
font-family:"Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #343838;
|
||||
|
||||
2
docs/css/cinder.min.css
vendored
2
docs/css/cinder.min.css
vendored
@@ -1 +1 @@
|
||||
body{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;line-height:1.7;background-color:#FFF;color:#343838}h1,h2,h3,h4,h5,h6{font-family:'Inter','Helvetica Neue',Helvetica,Arial,sans-serif;color:#222}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{color:#b1b7b9}h2{margin-top:35px}h1,h2{font-weight:700}h4{font-family:'Inter','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:300;margin-top:20px;font-style:italic}h5{font-family:'Inter','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:300;font-variant:small-caps}pre,code{background-color:#fcfdff}pre>code{font-size:13px}pre{margin-top:25px;margin-bottom:25px}.lead{font-family:"Inter","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.4;letter-spacing:.0312em;color:#b1b7b9}.navbar-default{background-color:#343838;border-bottom:8px #ebf2f2 solid}.bs-sidenav{background-image:url("../img/grid11.png");background-repeat:repeat;font-family:Inter,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px}.well{background-color:#fcfdff}.btn-default{background-color:#fcfdff}.table-striped>tbody>tr:nth-child(2n+1)>td,.table-striped>tbody>tr:nth-child(2n+1)>th{background-color:#fcfdff}#mkdocs-search-query:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#mkdocs-search-query{font-family:"Inter","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:20px;font-weight:700;color:#343838;height:45px}footer>hr{width:35%}
|
||||
body{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;line-height:1.7;background-color:#FFF;color:#343838}h1,h2,h3,h4,h5,h6{font-family:'PT Sans','Helvetica Neue',Helvetica,Arial,sans-serif;color:#222}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{color:#b1b7b9}h1,h2{font-weight:700}h4{font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:300;margin-top:20px;font-style:italic}h5{font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;font-weight:300;font-variant:small-caps}pre,code{background-color:#fcfdff}pre>code{font-size:13px}pre{margin-top:25px;margin-bottom:25px}.lead{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;line-height:1.4;letter-spacing:.0312em;color:#b1b7b9}.navbar-default{background-color:#343838;border-bottom:8px #ebf2f2 solid}.bs-sidenav{background-image:url("../img/grid11.png");background-repeat:repeat;font-size:12px}.well{background-color:#fcfdff}.btn-default{background-color:#fcfdff}.table-striped>tbody>tr:nth-child(2n+1)>td,.table-striped>tbody>tr:nth-child(2n+1)>th{background-color:#fcfdff}#mkdocs-search-query:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#mkdocs-search-query{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:20px;font-weight:700;color:#343838;height:45px}footer>hr{width:35%}
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<title>Customization - MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/base.min.css" rel="stylesheet">
|
||||
<link href="../css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="../css/highlight.min.css" rel="stylesheet">
|
||||
<link href="../css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -171,7 +169,8 @@ solver = LearningSolver(solver="cplex",
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="../js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="../js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = ".."</script>
|
||||
|
||||
<script src="../js/base.js"></script>
|
||||
@@ -183,11 +182,8 @@ solver = LearningSolver(solver="cplex",
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<title>Home - MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="css/base.min.css" rel="stylesheet">
|
||||
<link href="css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="css/highlight.min.css" rel="stylesheet">
|
||||
<link href="css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -197,7 +195,8 @@
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = "."</script>
|
||||
|
||||
<script src="js/base.js"></script>
|
||||
@@ -209,11 +208,8 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
@@ -277,5 +273,5 @@
|
||||
|
||||
<!--
|
||||
MkDocs version : 1.0.4
|
||||
Build Date UTC : 2020-02-24 16:57:12
|
||||
Build Date UTC : 2020-02-25 04:02:08
|
||||
-->
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<title>Problems - MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/base.min.css" rel="stylesheet">
|
||||
<link href="../css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="../css/highlight.min.css" rel="stylesheet">
|
||||
<link href="../css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -154,6 +152,10 @@
|
||||
<li class="third-level"><a href="#problem-definition_1">Problem definition</a></li>
|
||||
<li class="third-level"><a href="#random-instance-generator_1">Random instance generator</a></li>
|
||||
<li class="third-level"><a href="#challenge-a_1">Challenge A</a></li>
|
||||
<li class="second-level"><a href="#traveling-salesman-problem">Traveling Salesman Problem</a></li>
|
||||
|
||||
<li class="third-level"><a href="#problem-definition_2">Problem definition</a></li>
|
||||
<li class="third-level"><a href="#random-problem-generator">Random problem generator</a></li>
|
||||
</ul>
|
||||
</div></div>
|
||||
<div class="col-md-9" role="main">
|
||||
@@ -251,7 +253,26 @@ from the provided probability distributions <code>K</code> and <code>u</code>.</
|
||||
)
|
||||
</code></pre>
|
||||
|
||||
<p><img alt="alt" src="../figures/benchmark_knapsack_a.png" /></p></div>
|
||||
<p><img alt="alt" src="../figures/benchmark_knapsack_a.png" /></p>
|
||||
<h2 id="traveling-salesman-problem">Traveling Salesman Problem</h2>
|
||||
<h3 id="problem-definition_2">Problem definition</h3>
|
||||
<p>Given a list of cities and the distance between each pair of cities, the problem asks for the
|
||||
shortest route starting at the first city, visiting each other city exactly once, then returning
|
||||
to the first city. This problem is a generalization of the Hamiltonian path problem, one of Karp's
|
||||
21 NP-complete problems.</p>
|
||||
<h3 id="random-problem-generator">Random problem generator</h3>
|
||||
<p>The class <code>TravelingSalesmanGenerator</code> can be used to generate random instances of this
|
||||
problem. Initially, the generator creates $n$ cities $(x_1,y_1),\ldots,(x_n,y_n) \in \mathbb{R}^2$,
|
||||
where $n, x_i$ and $y_i$ are sampled independently from the provided probability distributions <code>n</code>,
|
||||
<code>x</code> and <code>y</code>. For each pair of cities $(i,j)$, the distance $d_{i,j}$ between them is set to:
|
||||
<script type="math/tex; mode=display">
|
||||
d_{i,j} = \gamma_{i,j} \sqrt{(x_i-x_j)^2 + (y_i - y_j)^2}
|
||||
</script>
|
||||
where $\gamma_{i,j}$ is sampled from the distribution <code>gamma</code>.</p>
|
||||
<p>If <code>fix_cities=True</code> is provided, the list of cities is kept the same for all generated instances.
|
||||
The $gamma$ values, and therefore also the distances, are still different.</p>
|
||||
<p>By default, all distances $d_{i,j}$ are rounded to the nearest integer. If <code>round=False</code>
|
||||
is provided, this rounding will be disabled.</p></div>
|
||||
|
||||
|
||||
</div>
|
||||
@@ -269,7 +290,8 @@ from the provided probability distributions <code>K</code> and <code>u</code>.</
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="../js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="../js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = ".."</script>
|
||||
|
||||
<script src="../js/base.js"></script>
|
||||
@@ -281,11 +303,8 @@ from the provided probability distributions <code>K</code> and <code>u</code>.</
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -14,16 +14,14 @@
|
||||
<title>Usage - MIPLearn</title>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
|
||||
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=PT+Sans:400,400italic,700,700italic&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
|
||||
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
|
||||
<link href="../css/base.min.css" rel="stylesheet">
|
||||
<link href="../css/cinder.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="../css/highlight.min.css" rel="stylesheet">
|
||||
<link href="../css/custom.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
@@ -254,7 +252,8 @@ solver.solve(test_instance)
|
||||
</footer>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="../js/bootstrap-3.0.3.min.js"></script>
|
||||
|
||||
<script src="../js/highlight.pack.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
<script>var base_url = ".."</script>
|
||||
|
||||
<script src="../js/base.js"></script>
|
||||
@@ -266,11 +265,8 @@ solver.solve(test_instance)
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user