mirror of
https://github.com/fverdugo/XM_40017.git
synced 2025-12-30 02:38:31 +01:00
build based on b8728d6
This commit is contained in:
@@ -7471,7 +7471,7 @@ a.anchor-link {
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput" data-mime-type="text/markdown">
|
||||
<h2 id="The-all-pairs-of-shortest-paths-(ASP)-problem">The all pairs of shortest paths (ASP) problem<a class="anchor-link" href="#The-all-pairs-of-shortest-paths-(ASP)-problem">¶</a></h2><p>Let us start by presenting the all pairs of shortest paths (ASP) problem and its solution with the <a href="https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm">Floyd–Warshall algorithm</a>.</p>
|
||||
<h2 id="The-All-Pairs-of-Shortest-Paths-(ASP)-problem">The All Pairs of Shortest Paths (ASP) problem<a class="anchor-link" href="#The-All-Pairs-of-Shortest-Paths-(ASP)-problem">¶</a></h2><p>Let us start by presenting the all pairs of shortest paths (ASP) problem and its solution with the <a href="https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm">Floyd–Warshall algorithm</a>.</p>
|
||||
<h3 id="Problem-statement">Problem statement<a class="anchor-link" href="#Problem-statement">¶</a></h3><ul>
|
||||
<li>Given a graph $G$ with a distance table $C$</li>
|
||||
<li>Compute the length of the shortest path between any two nodes in $G$</li>
|
||||
@@ -7504,12 +7504,12 @@ a.anchor-link {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs" id="cell-id=4fe447c5">
|
||||
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell" id="cell-id=4fe447c5">
|
||||
<div class="jp-Cell-inputWrapper" tabindex="0">
|
||||
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea">
|
||||
<div class="jp-InputPrompt jp-InputArea-prompt">In [ ]:</div>
|
||||
<div class="jp-InputPrompt jp-InputArea-prompt">In [1]:</div>
|
||||
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
|
||||
<div class="cm-editor cm-s-jupyter">
|
||||
<div class="highlight hl-julia"><pre><span></span><span class="k">function</span><span class="w"> </span><span class="n">floyd!</span><span class="p">(</span><span class="n">C</span><span class="p">)</span>
|
||||
@@ -7529,6 +7529,18 @@ a.anchor-link {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell-outputWrapper">
|
||||
<div class="jp-Collapser jp-OutputCollapser jp-Cell-outputCollapser">
|
||||
</div>
|
||||
<div class="jp-OutputArea jp-Cell-outputArea">
|
||||
<div class="jp-OutputArea-child jp-OutputArea-executeResult">
|
||||
<div class="jp-OutputPrompt jp-OutputArea-prompt">Out[1]:</div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output jp-OutputArea-executeResult" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>floyd! (generic function with 1 method)</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=b27707b9">
|
||||
<div class="jp-Cell-inputWrapper" tabindex="0">
|
||||
@@ -7540,12 +7552,12 @@ a.anchor-link {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs" id="cell-id=860e537c">
|
||||
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell" id="cell-id=860e537c">
|
||||
<div class="jp-Cell-inputWrapper" tabindex="0">
|
||||
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea">
|
||||
<div class="jp-InputPrompt jp-InputArea-prompt">In [ ]:</div>
|
||||
<div class="jp-InputPrompt jp-InputArea-prompt">In [2]:</div>
|
||||
<div class="jp-CodeMirrorEditor jp-Editor jp-InputArea-editor" data-type="inline">
|
||||
<div class="cm-editor cm-s-jupyter">
|
||||
<div class="highlight hl-julia"><pre><span></span><span class="n">inf</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1000</span>
|
||||
@@ -7561,6 +7573,22 @@ a.anchor-link {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell-outputWrapper">
|
||||
<div class="jp-Collapser jp-OutputCollapser jp-Cell-outputCollapser">
|
||||
</div>
|
||||
<div class="jp-OutputArea jp-Cell-outputArea">
|
||||
<div class="jp-OutputArea-child jp-OutputArea-executeResult">
|
||||
<div class="jp-OutputPrompt jp-OutputArea-prompt">Out[2]:</div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output jp-OutputArea-executeResult" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>4×4 Matrix{Int64}:
|
||||
0 9 6 1
|
||||
2 0 8 3
|
||||
5 3 0 6
|
||||
10 8 5 0</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=b9eeb64d">
|
||||
<div class="jp-Cell-inputWrapper" tabindex="0">
|
||||
@@ -7731,7 +7759,7 @@ a.anchor-link {
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput" data-mime-type="text/markdown">
|
||||
<p>TODO explain this part</p>
|
||||
<p>At each iteration, the processor needs the input values <code>C[i,j]</code>, <code>C[i,k]</code> and <code>C[k,j]</code>. Since we split the data row-wise, the process already has values <code>C[i,j]</code> and <code>C[i,k]</code>. However, <code>C[k,j]</code> may be stored in a different process.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -7749,6 +7777,17 @@ a.anchor-link {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=a01872ef">
|
||||
<div class="jp-Cell-inputWrapper" tabindex="0">
|
||||
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput" data-mime-type="text/markdown">
|
||||
<p>As we iterate over columns $j$, the process needs input from all values of row $k$. Therefore, at the start of iteration $k$, the whole row $k$ needs to be communicated.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=3261af17">
|
||||
<div class="jp-Cell-inputWrapper" tabindex="0">
|
||||
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
|
||||
|
||||
Reference in New Issue
Block a user