Don't bring a tree to a mesh fight
Don&#x27;t bring a mesh &#x2F; graph to a hypergraph fight. Hypergraphs seem to be the &quot;biggest generalization&quot; I&#x27;ve come across in the list -&gt; tree -&gt; graph -&gt; hypergraph hierarchy. (That is: all lists are trees. All trees are graphs. All graphs are hypergraphs)<p>In a graph, an &quot;edge&quot; connects two nodes. In hypergraphs, a &quot;hyperedge&quot; can connect 2-or-more nodes.<p>-------<p>You might think that hypergraphs are purely theoretical, except... they are in common usage all the time. You might also know hypergraphs by their alternative name: Relational Tables.<p>Well, I&#x27;m being loose with the language last paragraph. A relational-table is really a hyper-edge. And the nodes of the hypergraphs are the domains of whatever you&#x27;re working with.<p>If your relational-table only has 2-columns, you have a normal graph relationship between the data. But as anyone who has worked with relational databases knows: you often have 3-columns, 4-columns or more to represent the data. Once you reach 3-columns &#x2F; 4-columns or beyond, you no longer are working with &quot;simple&quot; graphs but instead hypergraphs, and the theoretical complexity of the whole system reaches a new level.<p>--------<p><pre><code>    CREATE TABLE PersonsHyperedges (
        PersonID int,
        LastName varchar(255),
        FirstName varchar(255),
        Address varchar(255),
        City varchar(255)
    );
</code></pre>
You can imagine this Table as a list of hyperedges, connecting &quot;PersonID&quot;, &quot;LastName&quot;, &quot;FirstName&quot;, &quot;Address&quot; and &quot;City&quot; nodes together.<p>--------<p><pre><code>    CREATE TABLE PersonsGraphEdges (
        LastName varchar(255),
        FirstName varchar(255),
    );
</code></pre>
In this case, since there&#x27;s only 2-elements in the &quot;hyperedge&quot;, this table is a list of &quot;normal graph-edges&quot;<p>-----------<p>There are also things &quot;in-between&quot;. Bipartite graphs are very common for example. The hierarchy fits as &quot;tree -&gt; bipartite graph -&gt; graph&quot; (all trees are bipartite graphs).<p>If you have assurances that your problem you&#x27;re working with is bipartite, then favor bipartite graph algorithms. There are a lot of NP-complete problems over graphs that are in P for bipartite-graphs