<p>It is not that simple for <strong>one-mode networks</strong>, but you're close.</p>

<p>The network matrix <code>M</code> itself tells you which node is connected to which other node in one step. <code>M * M</code> tells you which node is connected to which other node in <em>exactly two</em> steps, <code>M ^ 3</code> whether in <em>exactly three</em> steps, and so on. "Exactly" is important, because if nodes are not connected to themselves (zero diagonal elements), then <code>M * M</code> does not only obtain two-step connectivity, but also loses one-step connectivity.</p>

<p>The products (powers) are therefore more useful if all nodes are connected to themselves:</p>

<pre><code>A = (M + eye(size(M)) &gt; 0)
</code></pre>

<p>This step also converts a weighted matrix into a pure adjacency matrix. Now</p>

<pre><code>(A ^ i &gt; 0)
</code></pre>

<p>gives you the information whether two nodes are connected in <code>i</code> steps <em>or less</em>. In a network with <code>n = size(M, 1)</code> nodes, the distance between two nodes can be at most <code>n - 1</code> steps. Therefore</p>

<pre><code>C = (A ^ (n - 1) &gt; 0)
</code></pre>

<p>gives you the information whether two nodes are connected <em>at all</em>. The whole network is connected if there are no pairs of unconnected nodes, i.e. if</p>

<pre><code>connected = (sum(C(:)) == N ^ 2)
</code></pre>

<hr>

<p>I'm not sure how one would define connectedness in a <strong>two-mode network</strong>. A simple approach would be to just disregard the difference between the two types of nodes, and consider them all to be part of a one-mode network. If <code>M</code> is the original two-mode network matrix of size <code>[m, n] = size(M)</code>, then </p>

<pre><code>M = [zeros(m, m) , M ; M' ; zeros(n, n)];
</code></pre>

<p>converts it into the matrix describing the corresponding one-mode network of size <code>(m+n)</code>x<code>(m+n)</code>.</p>

<hr>

<p>These matrix powers do not only tell you whether the whole network is connected, they can also be used to find the connected sub-networks (network clusters) if it is not. Since the behavior of powers of a matrix is closely connected to its spectral decomposition (a.k.a. <a href="https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix" rel="nofollow">eigendecomposition</a>), this idea leads to the approach of <a href="https://en.wikipedia.org/wiki/Spectral_clustering" rel="nofollow">spectral clustering</a>. For an application to weighted synchronization networks, see e.g. <a href="http://arxiv.org/abs/0707.2479" rel="nofollow">arXiv:0706.3375</a>.</p>
Determine whether a network (graph) is connected based on its matrix
<p>How can I determine from a given m x n matrix desribing a two-mode network whether it is connected or not?</p>

<p>Of course once can create a data structure for finding it out – but is there any mathematical solution?</p>

<p>I found out for n x n matrices (one-mode network) it is easy: The solution would be: <code>M * M</code> and then looking at the diagonal in the resulting matrix. If there is any zero on the diagonal then it is not connected. Isn't that true?</p>

<p>What would be your suggestion for both problems?</p>