\documentclass[landscape]{slides}

\usepackage{multicol}
\usepackage{sober}
\input{preamble}

\input{SLIDES}

\usepackage[dvips]{graphics}
\usepackage[all,poly,ps,dvips,color]{xy}
\UseCrayolaColors

\DeclareMathOperator{\mathin}{in}
\DeclareMathOperator{\mathout}{out}


\newcommand{\vindex}[2]{\left[ #1 \right] _ #2}
\newcommand{\eigen}{\mathbf a}
\newcommand{\elem}{\mathbf e}
\newcommand{\state}{\mathbf x}
\newcommand{\maxdeg}{\Delta}
\newcommand{\maxdegC}{d_{max}}

\newcommand{\din}{d_{\mathin}}
\newcommand{\dout}{d_{\mathout}}
\newcommand{\dmax}{d_{\max}}


\newcommand{\nlabel}[2]{\ar@{} @(#1,#1) |<<{#2}}
\newcommand{\gnlabel}[2]{[#1(.25)] {#2}}
\newcommand{\node}{{\bullet}}
\newcommand{\bypass}{{\circ}}

\title{Migration with Memory Constraints}

\author{Jason Hartline, Anna Karlin, Jared Saia}

\begin{document}

\begin{titlepage}
\title{{\blue Algorithms for Efficient Data Migration}}

%\author {Jared Saia \\ \ \\
%Joint work with  \\
%Joe Hall, Jason Hartline, Anna R. Karlin \\
%University of Washington\\
%and John Wilkes - HP Labs}

\author {Jared Saia \\
{\red University of Washington} \\ \ \\
Joint work with  \\
Joe Hall, Jason Hartline, Anna R. Karlin \\
{\red University of Washington}\\
John Wilkes\\
{\red HP Labs}
}



\date{}
\maketitle

\end{titlepage}

\begin{SLIDE}[Motivation]
\begin{itemize}
\item Performance of large storage system depends on having
data assignment which balances request load \\

\item Optimal layout of data changes with changing workloads \\

\item Want to periodically recompute a new optimal assignment of data
to devices [Borowsky et al, 1997][Gavish et al, 1990] \\

\item Must move data to new optimal assignment {\bf as quickly as possible}
\end{itemize}
\end{SLIDE}

\begin{SLIDE}[Migration Problem]
Given: 
\begin{itemize}
\item Initial and final configuration of data objects on devices \\
\item Description of the storage system.
\end{itemize}

Our Goal:
To compute a {\em migration plan} obeying network constraints and using minimal
number of time steps. \\

Key constraint:\\
{\red In one time step each storage device can be involved in the transfer
of one data object.}
\end{SLIDE}

\begin{SLIDE}[Demand Graph]
{\red Assume network is a complete graph}

%Demand Graph (directed multigraph)

\begin{center}
\begin{tabular}{ccc}
Initial & Goal & Demand Graph\\

$\begin{graph}
!{/r4pc/:}
[] !P4"V"{~={135}~>{}{\node}},
"V1" -@[grey] "V2"
"V1" -@[grey] "V3"
"V1" -@[grey] "V4"
"V2" -@[grey] "V3"
"V2" -@[grey] "V4"
"V3" -@[grey] "V4"
"V1" [l(.25)] {\red a}
"V2" [l(.5)] {\red b,c}
"V3" [r(.5)] {\red d}
\end{graph}$
&
$\begin{graph}
!{/r4pc/:}
[] !P4"V"{~={135}~>{}{\node}},
"V1" -@[grey] "V2"
"V1" -@[grey] "V3"
"V1" -@[grey] "V4"
"V2" -@[grey] "V3"
"V2" -@[grey] "V4"
"V3" -@[grey] "V4"
"V1" [l(.5)] {\red b,c}
"V2" [l(.5)] {\red a}
"V4" [r(.25)] {\red d}
\end{graph}$
&

$\begin{graph}
!{/r4pc/:}
[] !P4"V"{~={135}~>{}{\node}},
"V3" :@//^{\red d} 
"V4",
"V2" :@/^/^{\red b}
"V1" :@/^/^{\red a}
"V2" :@/^2pc/^{\red c}
"V1",
\end{graph}$

\end{tabular}
\end{center}

Output: Assignment of time steps to each edge in demand graph such
that no two edges incident to same node are assigned the same time
step

\end{SLIDE}

%\begin{SLIDE} [Edge Coloring]

%Simple Migration Model:

%\begin{itemize}
%\item Assume fully connected network \\
%\item In one time step, each storage device can be involved in the
%transfer of one data object. \\
%\end{itemize}

%Thus the simple migration problem is equivalent to edge coloring.

%\end{SLIDE}



\begin{SLIDE}[Multigraph Edge Coloring]
\begin{itemize}
\item Minimum number of colors for edge coloring is $\chi'$ \\
\item Maximum degree of graph ($\Delta$) is trivial lower bound on
$\chi'$ \\
\item Computing $\chi'$ is NP-Complete [Hoyer, 1981] \\
\item Best known approximation algorithm for multigraphs is $9/8 \chi' + 3/4$
[Hochbaum et al, 1996] 
\end{itemize}
\end{SLIDE}



\begin{SLIDE}[Beyond Edge Coloring]

\begin{itemize}
\item Indirect migration \\
\begin{itemize}
\item Allowed to send an object through intermediate or {\em bypass nodes}
\item This can decrease the number of time steps required \\
\end{itemize} 

\item Migration with memory constraints \\

\begin{itemize}
\item In any intermediate stage of the plan, all machines must have a number
of objects stored on them less than or equal to the memory of that
machine.
\end{itemize}

\end{itemize}

\end{SLIDE}

%slide showing how b-nodes help
\begin{SLIDE}[Indirect Migration]

\begin{center}
\begin{tabular}{ccc}

$
\xymatrix{
        & {\node} \ar[dr] \\
{\node} \ar[ur] &         & {\node}  \ar[ll]
}
$
&

& 
$
\xymatrix{
        & {\node} \ar@{.>}[dr] \ar[r] & {\bypass} \ar[d] \\
{\node} \ar[ur] &         & {\node} \ar[ll]
}
$

\end{tabular}

\end{center}
\end{SLIDE}


\begin{SLIDE}[Memory Constraints]

Let $d_i(v)$, $d_o(v)$ be the in,out degree of node v respectively

\begin{itemize}

\item Need $d_o(v)$ memory at start at node $v$

\item Need $d_i(v)$ memory at the end at node $v$

\item $\Longrightarrow$ need $\max(d_o(v),d_i(v))$ memory total

\end{itemize}

Let $M(v) = \max(d_o(v),d_i(v))+1$

Examples: 
\begin{center}
\begin{tabular}{cccc}
\xymatrix{
\ar@<-.5ex>[d] \ar@<.5ex>[d]\\
{\node} \ar@<-.5ex>[d] \ar@<.5ex>[d]  \\
\\
}
&

&

&
\xymatrix{
\ar@<-.5ex>[d] \ar@<.5ex>[d]  \ar[d]\\
{\node} \ar@<-.5ex>[d] \ar@<.5ex>[d]\\
\\
}
\end{tabular}
\end{center}
\end{SLIDE}

\begin{SLIDE}[What can we hope for?]

Given: arbitrary directed multigraph $G$ with max degree $\Delta$ and
$n$ nodes.

\begin{itemize}
\item Clearly need $\geq \Delta$ steps for any migration

\item In worst case, need $n/3$ bypass nodes to achieve $\Delta$

\end{itemize}

$$
\underbrace{\begin{graph}
[] !P3{~:{/r1.5pc/:}~><{@{->}}{\node}}  
[rr] !P3{~:{/r1.5pc/:}~><{@{->}}{\node}} 
[rr]{\ldots}
[rr] !P3{~:{/r1.5pc/:}~><{@{->}}{\node}} 
\end{graph}}_{n/3}
$$

Direct migrations
\begin{itemize}
\item need $\geq \chi'$ steps
\item in worst case, $\chi' = \frac{3}{2} \Delta$
\end{itemize}

\end{SLIDE}


\begin{SLIDE}[Our Results]
Given: arbitrary directed multigraph $G$ with max degree $\Delta$ and
$n$ nodes.

No memory constraints:
\begin{itemize}
\item $2\lceil \Delta/2 \rceil$ steps using $\leq n/3$ bypass nodes
\end{itemize}

With memory constraints:
\begin{itemize}
\item $4 \lceil \Delta / 4 \rceil$ steps using $\leq n/3$ bypass nodes
\item $6 \lceil \Delta / 4 \rceil$ steps for direct migration

\end{itemize}

{\red Essentially match worst case bounds}

\end{SLIDE}


\begin{SLIDE}[{\large Indirect with Memory Contraints}]
\begin{enumerate}
\item Factor graph into {\em good} set of $4$-regular subgraphs
($4$-factors) \\

$4$-factor Property: After any $4$-factor is satisfied with memory
constraints, there is at least one free space at every vertex. \\

\item Satisfy each $4$-factor while obeying memory constraints
\end{enumerate}
\end{SLIDE}

\begin{SLIDE}[Getting good $4$-factors]

\begin{center}
\begin{tabular}{ccccc}
\xymatrix{
{\node} \ar@<-.25ex>[dd] \ar@<.25ex>[dd] \ar@<.25ex>[rr]
\ar@<-.25ex>[rr] \ar@<-.75ex>[dd] \ar@<.75ex>[dd] \ar@<.75ex>[rr]
\ar@<-.75ex>[rr] & & \ar@<-.25ex>[dd] \ar@<.25ex>[dd] {\node}
\ar@<-.75ex>[dd] \ar@<.75ex>[dd]\\
\\
{\node} \ar@<-.25ex>[rr] \ar@<.25ex>[rr] \ar@<-.75ex>[rr]  &  & {\node} \ar@<-.75ex>[ll] \\
}
&
\raisebox{-3ex}{=}
&
\xymatrix{
{\node} \ar@<-.25ex>[dd] \ar@<.25ex>[dd] \ar@<.25ex>[rr] \ar@<-.25ex>[rr] &  & {\node} \ar@<-.25ex>[dd] \ar@<.25ex>[dd]\\
\\
{\node} \ar@<-.25ex>[rr] \ar@<.25ex>[rr] &  & {\node} \\
}
&
\raisebox{-3ex}{$\cup$}
&
\xymatrix{
{\node} \ar@<-.75ex>[dd] \ar@<.75ex>[dd] \ar@<.75ex>[rr] \ar@<-.75ex>[rr] &  & {\node} \ar@<-.75ex>[dd] \ar@<.75ex>[dd]\\
\\
{\node} \ar@<-.75ex>[rr] &  & {\node} \ar@<-.75ex>[ll]\\
}
\end{tabular}
\end{center}

$4$-factor Property: After any $4$-factor is satisfied with memory
constraints, there is at least one free space at every vertex.

Idea: Construct factoring such that in-edges on original graph
distributed ``evenly'' across the $4$-factors.

%ratio of in-edges to out-edges in
%each $4$-factor $\approx d_i/d_o$

Two cases:
\begin{itemize}
\item $d_o \geq d_i$ - each $4$-factor can only generate free space
\item $d_i < d_o$ - never use more than initial amount of free space
\end{itemize}

\end{SLIDE}


\begin{SLIDE}[Satisfying $4$-factors]

\begin{tabular}{cc}

\raisebox{-.3ex}{{\em Hard} vertices:} & 

%\xymatrix{
%\ar@<-.5ex>[d] \ar@<.5ex>[d]\\
%{\node} \ar@<-.5ex>[d] \ar@<.5ex>[d]  \\
%\\
%}

\xymatrix{
\ar@<-.5ex>[r] \ar@<.5ex>[r] & {\node} \ar@<-.5ex>[r] \ar@<.5ex>[r] & \\
}

\end{tabular}

Goal: label edges with letters {\it A} and {\it B} such that 
\begin{itemize}
\item each vertex has $2$ edges labelled {\it A} and two labelled {\it 
B}
\item each {\em hard} vertex has one out edge labelled {\it A}
\end{itemize}

With such {\it A}/{\it B} labelling, we have two stages:
\begin{enumerate}
\item Perform migration on {\it A} labelled edges
\item Perform migration on {\it B} labelled edges
\end{enumerate}

Two time steps for each stage with $\leq n/3$ bypass nodes.

{\bf Problem:} There are $4$-regular multigraphs in which {\bf no}
such {\it A}/{\it B} labelling exists.

\end{SLIDE}


\begin{SLIDE}[Satisfying $4$-factors]

\begin{tabular}{cccc}
\includegraphics{migration.20} &
\includegraphics{migration.21} &
\includegraphics{migration.22}&
\includegraphics{migration.23} \\
{\small Original Graph} & {\small Split Hard Vertices} &
{\small Euler-Tours} & {\small {\it A}/{\it B} labelling complete}\\
\end{tabular}

Even length components: {\it A}/{\it B} label with Euler tour \\
{\bf Problem:} odd length components \\  

First idea: introduce one bypass node per odd component \\
{\bf Problem:} can be too many odd components ($2n/5$) \\ 

Solution: Merge {\it adjacent} odd components and judiciously choose which edge to bypass in remaining odd components.

\end{SLIDE}

\begin{SLIDE}[Conclusion and Open Problems]

Results:
\begin{itemize}
\item  First results on migration with indirection and memory constraints
\item For worst case inputs, results are optimal!
\end{itemize}

Many open problems:
\begin{itemize}
\item Is chromatic index with space constraints $>$ chromatic index
without?
\item What is tradeoff between number of bypass nodes available and
number of steps required?
\item What can we say about migration on incomplete topologies?
\end{itemize}
\end{SLIDE}



\end{document}



%\begin{SLIDE}[Direct, No Memory Constraints]

%INPUT: Demand Graph (directed multigraph)\\
%\begin{center}
%\begin{tabular}{ccc}
%Initial & Goal & Demand Graph\\
%$\begin{graph}
%!{/r4pc/:}
%[] !P4"V"{~={135}~>{-}{\node}},
%"V1" - "V3",
%"V2" - "V4",
%"V1" [u(.25)] {v_1}
%"V2" [d(.25)] {v_2}
%"V3" [d(.25)] {v_3}
%"V4" [u(.25)] {v_4}
%"V1" [l(.25)] {\red a}
%"V2" [l(.5)] {\red b,c}
%"V3" [r(.5)] {\red d}
%\end{graph}$
%&
%$\begin{graph}
%!{/r4pc/:}
%[] !P4"V"{~={135}~>{-}{\node}},
%"V1" - "V3",
%"V2" - "V4",
%"V1" [u(.25)] {v_1}
%"V2" [d(.25)] {v_2}
%"V3" [d(.25)] {v_3}
%"V4" [u(.25)] {v_4}
%"V1" [l(.5)] {\red b,c}
%"V2" [l(.5)] {\red a}
%"V4" [r(.25)] {\red d}
%\end{graph}$
%&

%% "V4" :@/^/^{\red d} 
%%  "V3" :@/^/^{\red e} 
%%  "V4" :@{=>}_{\red b,c} 
%%  "V1" :_{\red a} 
%%  "V2",

%$\begin{graph}
%!{/r4pc/:}
%[] !P4"V"{~={135}~>{}{\node}},
%"V1" [u(.25)] {v_1}
%"V2" [d(.25)] {v_2}
%"V3" [d(.25)] {v_3}
%"V4" [u(.25)] {v_4}
%"V3" :@//^{\red d} 
%"V4",
%"V2" :@/^/^{\red b}
%"V1" :@/^/^{\red a}
%"V2" :@/^2pc/^{\red c}
%"V1",
%\end{graph}$

%\end{tabular}
%\end{center}


%OUTPUT:Assignment of time steps to each edge in Demand Graph \\

%\end{SLIDE}







%\begin{SLIDE}[Lower Bounds]

%Let $\Delta$ be the max degree of the Demand Graph:\\

%1)All plans for any Demand Graph take $\geq \Delta$ steps. \\
%2)There are Demand Graphs for which any direct plan takes $\frac{3}{2}\Delta$\\

%Example:\\

%\end{SLIDE}

%\begin{SLIDE}[Indirect Plans]

%In this variant, assume an object can pass through intermediate nodes.\\

%These {\em bypass nodes} may reduce the number of steps in the plan.

%Goal: Minimize steps taken and bypass nodes needed.\\
%Idea: Turn odd cycles into even cycles with bypass nodes.

%\end{SLIDE}


%In worst case, need $n/3$ bypass nodes to achieve $\Delta$ steps.

%\begin{center}
%\begin{tabular}{cccc}
%$
%\xymatrix{
%        & {\node} \ar[dr] \\
%{\node} \ar[ur] &         & {\node}  \ar[ll]
%}
%$
%& 
%$
%\xymatrix{
%        & {\node} \ar[dr] \\
%{\node} \ar[ur] &         & {\node}  \ar[ll]
%}
%$
%& 
%...
%$
%\xymatrix{
%        & {\node} \ar[dr] \\
%{\node} \ar[ur] &         & {\node}  \ar[ll]
%}
%$
%\end{tabular}
%\end{center}




%\end{SLIDE}

%\begin{SLIDE}[Migration with Memory Constraints]

%Our main result:

%\begin{tabular}{l|l|l}
%& steps needed & bypass nodes needed \\
%\hline \\
%Mem constraints: & $6 \lceil \Delta / 4 \rceil$ & $0$ \\
%& $4 \lceil \Delta / 4 \rceil$ & $n/3$ \\
%\hline \\
%{\grey No mem constraints:} & {\grey $9/8 \chi' + 3/4$} &
%{\grey $0$ }\\
%& {\grey $2 \lceil \Delta/2 \rceil$} & {\grey $n/3$}\\
%\end{tabular}

%\end{SLIDE}


%\begin{SLIDE}[How to get good 4-factors]
%\begin{enumerate}
%\item For a given demand graph $G=(V,E)$ create $G'=(V',E')$.  Divide edges
%on $x \in V$ among $x_i,x_o \in V'$.

%\item $2$-factor $G'$ and merge nodes to get good $4$-factoring of $G$.
%\end{enumerate}

%\end{SLIDE}

%$\begin{graph}
%!{/r4pc/:}
%[] !P4"V"{~={135}~>{-}{\node}},
%"V1" - "V3",
%"V2" - "V4",
%"V1" [l(.25)] {\red a}
%"V2" [l(.5)] {\red b,c}
%"V3" [r(.5)] {\red d}
%\end{graph}$
%&
%$\begin{graph}
%!{/r4pc/:}
%[] !P4"V"{~={135}~>{-}{\node}},
%"V1" - "V3",
%"V2" - "V4",
%"V1" [l(.5)] {\red b,c}
%"V2" [l(.5)] {\red a}
%"V4" [r(.25)] {\red d}
%\end{graph}$
