Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions notebooks/p-median.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"\n",
"**P-Median can be written as:**\n",
"\n",
"$\\begin{array} \\displaystyle \\textbf{Minimize} & \\displaystyle \\sum_{i \\in I}\\sum_{j \\in J}{a_i d_{ij} X_{ij}} &&& (1) \\\\\n",
">$\\begin{array} \\displaystyle \\textbf{Minimize} & \\displaystyle \\sum_{i \\in I}\\sum_{j \\in J}{a_i d_{ij} X_{ij}} &&& (1) \\\\\n",
"\\displaystyle \\textbf{Subject to:} & \\displaystyle \\sum_{j \\in J}{X_{ij} = 1} & \\forall i \\in I && (2) \\\\\n",
" & \\displaystyle \\sum_{j \\in J}{Y_{j} = p} &&& (3) \\\\\n",
" & X_{ij} \\leq Y_{j} & \\forall i \\in I & \\forall j \\in J & (4) \\\\\n",
" & X_{ij} \\in \\{0,1\\} & \\forall i \\in I & \\forall j \\in J & (5) \\\\\n",
" & Y_{j} \\in \\{0,1\\} & \\forall j \\in J && (6) \\\\ \\end{array}$\n",
"\n",
"$\\begin{array} \\displaystyle \\textbf{Where:}\\\\ & & \\displaystyle i & \\small = & \\textrm{index referencing nodes of the network as demand} \\\\\n",
">$\\begin{array} \\displaystyle \\textbf{Where:}\\\\ & & \\displaystyle i & \\small = & \\textrm{index referencing nodes of the network as demand} \\\\\n",
"& & j & \\small = & \\textrm{index referencing nodes of the network as potential facility sites} \\\\\n",
"& & d_{ij} & \\small = & \\textrm{shortest distance or travel time between nodes } i \\textrm{ and } j \\\\\n",
"& & p & \\small = & \\textrm{number of facilities to be located} \\\\\n",
Expand All @@ -39,7 +39,7 @@
" \\end{cases} \\\\ \n",
"\\end{array}$\n",
"\n",
"_The formulation above is adapted from Church and Murray (2018)_\n",
">_The formulation above is adapted from Church and Murray (2018)_\n",
"\n",
"This tutorial generates synthetic demand (clients) and facility sites near a 10x10 lattice representing a gridded urban core.\n",
"\n",
Expand Down Expand Up @@ -1676,15 +1676,15 @@
"\n",
"**Capacitated P-Median can be written as:**\n",
"\n",
"$\\begin{array} \\displaystyle \\textbf{Minimize} & \\displaystyle \\sum_{i \\in I}\\sum_{j \\in J}{a_i d_{ij} X_{ij}} &&& (1) \\\\\n",
">$\\begin{array} \\displaystyle \\textbf{Minimize} & \\displaystyle \\sum_{i \\in I}\\sum_{j \\in J}{a_i d_{ij} X_{ij}} &&& (1) \\\\\n",
"\\displaystyle \\textbf{Subject to:} & \\displaystyle \\sum_{j \\in J}{X_{ij} = 1} & \\forall i \\in I && (2) \\\\\n",
" & \\displaystyle \\sum_{j \\in J}{Y_{j} = p} &&& (3) \\\\\n",
" & \\displaystyle \\sum_{i \\in I}{a_i X_{ij} \\leq {c_j Y_{j}}}& \\forall j \\in J && (4) \\\\\n",
" & X_{ij} \\leq Y_{j} & \\forall i \\in I & \\forall j \\in J & (5) \\\\\n",
" & X_{ij} \\in \\{0,1\\} & \\forall i \\in I & \\forall j \\in J & (6) \\\\\n",
" & Y_{j} \\in \\{0,1\\} & \\forall j \\in J && (7) \\\\ \\end{array}$\n",
"\n",
"$\\begin{array} \\displaystyle \\textbf{Where:}\\\\ & & \\displaystyle i & \\small = & \\textrm{index referencing nodes of the network as demand} \\\\\n",
">$\\begin{array} \\displaystyle \\textbf{Where:}\\\\ & & \\displaystyle i & \\small = & \\textrm{index referencing nodes of the network as demand} \\\\\n",
"& & j & \\small = & \\textrm{index referencing nodes of the network as potential facility sites} \\\\\n",
"& & d_{ij} & \\small = & \\textrm{shortest distance or travel time between nodes } i \\textrm{ and } j \\\\\n",
"& & p & \\small = & \\textrm{number of facilities to be located} \\\\\n",
Expand All @@ -1700,7 +1700,7 @@
" \\end{cases} \\\\ \n",
"\\end{array}$\n",
"\n",
"_The formulation above is adapted from Church and Murray (2009)_"
">_The formulation above is adapted from Church and Murray (2009)_"
]
},
{
Expand Down