<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">Below is a python function to generate Markov path (the travelling salesman problem).</p><pre class="" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">def</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> generate_travel_path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">):</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">assert</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">shape</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">==</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">shape</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">assert</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">shape</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">

    p </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">copy</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    path </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">*</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">for</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> k </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">in</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> range</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">):</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        k1 </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">k</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        row_sums </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">/</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> p</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[:,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> k1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">])</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        p </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">*=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> row_sums</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[:,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">newaxis</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        p</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[:,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> k1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
        path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">k</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">random</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">multinomial</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> p</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">k1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:]).</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">argmax</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">

    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">assert</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> len</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">set</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">))</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">==</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">return</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> path</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px"><code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:pre-wrap;background-color:rgb(238,238,238)">markov_matrix</code> is a predefined Markov transition matrix. The code generates a path starting from node zero and visit every node once based on this matrix.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px">However I feel the function is quite slow. Below is the line-by-line profile with a 53x53 <code style="margin:0px;padding:1px 5px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:pre-wrap;background-color:rgb(238,238,238)">markov_matrix</code>:</p><pre class="" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Timer</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> unit</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">3.49943e-07</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> s

</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Total</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> time</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.00551195</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> s
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">File</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">ipython</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">input</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">29</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">37e4c9b5469e</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">></span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Function</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> generate_travel_path at line </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Line</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,128,128)">#      Hits         Time  Per Hit   % Time  Line Contents</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">==============================================================</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">                                           </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">def</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> generate_travel_path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">):</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">2</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">           </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">31</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">31.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.2</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">assert</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">shape</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">==</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">shape</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">3</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">           </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">12</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">12.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">assert</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">shape</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">4</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">5</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">           </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">99</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">99.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.6</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      p </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> markov_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">copy</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">6</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">           </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">12</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">12.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      path </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">*</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">7</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">53</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">416</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">7.8</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">2.6</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">for</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> k </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">in</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> range</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">):</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">8</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">52</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">299</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">5.8</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1.9</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          k1 </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">k</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">9</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">52</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">3677</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">70.7</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">23.3</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          row_sums </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">/</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> p</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[:,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> k1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">])</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">10</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">52</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">4811</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">92.5</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">30.5</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          p </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> p </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">*</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> row_sums</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[:,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">newaxis</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">11</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">52</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1449</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">27.9</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">9.2</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          p</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[:,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> k1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">12</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">        </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">52</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">4890</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">94.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">31.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">          path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">k</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">]</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">random</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">multinomial</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> p</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">[</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">k1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">:]).</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">argmax</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">()</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">13</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">14</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">           </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">51</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">     </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">51.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.3</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">assert</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> len</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">set</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">path</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">))</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">==</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">15</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">         </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">            </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">4</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">4.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">      </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">return</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> path</span></code></pre><pre class="" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;white-space:normal;background-color:rgb(255,255,255)">If I ran this function 25000 times, it will take me more than 125 seconds. Any headroom to improve the speed?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(34,34,34);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:19.5px;white-space:normal;background-color:rgb(255,255,255)">Below is a simple function to generate a Markov matrix.</p><pre class="" style="margin-top:0px;padding:5px;border:0px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">def</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> initial_trans_matrix</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">):</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    x </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">ones</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">((</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> n</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">))</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">/</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">n </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">-</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">fill_diagonal</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">x</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">0.0</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
    </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">return</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> x</span></code></pre></span></code></pre></div>