e graph, the adjacency matrix has a lot of wasted space), but I'm suggesting that here because it's a fairly straightforward one to work with in code. Set up your function to read in files with the following format:</p>
<pre style="margin-left: 30px; font-family: monospace; font-size: 11px; width: 600px; background-color: #fff9e7;">7<br />A<br />B<br />C<br />D<br />E<br />F<br />G<br />0 1 0 0 0 0 1<br />1 0 1 0 0 0 0<br />0 1 0 1 0 0 0<br />0 0 1 0 1 0 0<br />0 0 0 1 0 1 1<br />0 0 0 0 1 0 0<br />1 0 0 0 