I am trying to find all simple paths in a large directed graph (542 vertex, density ~ 5%) between two nodes. For this purpose, I use the algorithm from this thread. Unfortunately, my computer is running out of memory during this operation. I was thinking it would help to write the paths found directly to a text file, but I don't know how to do it in this case. Maybe, you'll have other suggestions as well. Here's the file with the adjacency matrix.

SetDirectory["C:\\Users\\crazyfrog\\Documents\\ДИПЛОМ"];
findPaths[a_?MatrixQ, s_Integer, t_Integer] := 
  Module[{child, find}, 
   child[v_] := Flatten@Position[a[[v]], Except@0, 1, Heads -&gt; False];
   find[v_, list_] := 
    Scan[If[# === t, Sow[Append[list, #]], 
       If[FreeQ[list, #], find[#, Append[list, #]]]] &amp;, child@v];
   If[# =!= {}, First@#, {}] &amp;@Last@Reap@find[s, {s}]];
findPaths[g_Graph, s_, t_] := 
  Module[{nodes = VertexList@g, convert}, 
   convert = Thread[nodes -&gt; Range@Length@nodes];
   findPaths[Normal@AdjacencyMatrix@g, s /. convert, t /. convert] /. 
    Reverse /@ convert];
&lt;&lt; JLink`;
InstallJava[];
ReinstallJava[JVMArguments -&gt; "-Xmx1024m"]; data = 
 Import["test.xlsx"][[1]]; data2 = Round[data];
g = AdjacencyGraph[data2];
$HistoryLength = 0; findPaths[g, 1, 542] &gt;&gt; "result.txt"



Question: Learning how to be a good rhythm guitarist before becoming a lead guitarist, where to start?
Answer: I'm addressing only your first paragraph. Assuming you want to stay pentatonic for now, and know the box in A based around the 5th to 8th frets, this should help. The box below that has basically two notes per string, as the box you know. Each higher note on each string is the SAME note as the lower one in your known box.So you already know HALF of it !!  Guess what - the next box up uses for its bottom notes the same ones as the TOP notes of your known box. Thus you already know HALF of that one !!  So - in order to use all three boxes, you only need to replicate the pentatonic notes around frets 2/3  and frets 7/10. If you start the higher box on 6th string, 8th fret, and use the Am pent. notes, you'll hopefully realise that it's actually C maj. pent. you're playing. It happens to use EXACTLY the same 5 notes, so you can solo along regardless.