-
Notifications
You must be signed in to change notification settings - Fork 3
/
pseudocode-spprc.tex
36 lines (33 loc) · 1.21 KB
/
pseudocode-spprc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
%\documentclass[a4paper,11pt]{article}
%\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
%%\newcommand{\setfont}[1]{\mathcal{#1}}
%\newcommand{\setfont}[1]{#1}
%\begin{document}
\begin{algorithm}[h!]
\DontPrintSemicolon % Some LaTeX compilers require you to use \dontprintsemicolon instead
\KwIn{digraph $G=(V,E)$ with start node $s \in V$, target node $t \in V$, resource windows for all nodes %$[t_a, t_d] \, \forall v \in V$
and resource vectors for all edges} %$(t,c) \, \forall e \in E$}
\KwOut{feasible, pareto-optimal $s$-$t$ path $l^*$ with minimal cost} \vspace{0.2cm}
(* Initialize *) \;
$U \gets \{(\epsilon,s)\}$ and $P \gets \emptyset$ \;
(* Main Loop *) \;
\While{$\exists l=(\sim,v) \in U$}{
$U \gets U \setminus \{l\}$\;
(* Path extension step *)\;
\ForAll{$e=(v,w) \in E$}{
$l'=(l,w) \gets$ EXTEND$(l,e)$\;
\If{$l' \in \mathrm{FEASIBLE}(w)$}{
$U \gets U \cup \{l'\}$\;
}
}
$P \gets P \cup \{l\}$\;
(* Dominance step *)\;
\ForAll{$v \in V\setminus\{s\}$}{
$U,P \gets$ REMOVE-DOMINATED$(U,P)$\;
}
}
((* Filtering step *))\;
$l^* \in P \; | \; cost(l^*) ==\min( \{ cost(l=(\sim,t)\in P) \} )$\;
\caption{Generic Dynamic Programming SPPTW Label Setting Algorithm}
\end{algorithm}
%\end{document}