TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Don't bring a tree to a mesh fight

48 pointsby valandover 3 years ago

3 comments

dragontamerover 3 years ago
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
评论 #29324254 未加载
评论 #29328410 未加载
评论 #29324739 未加载
runnerupover 3 years ago
I think there&#x27;s a typo:<p>&gt; It is in the shape of a Directed Acyclic Rooted Tree or simply a tree. The neat thing is, a tree-shaped computation is always &quot;one-pass&quot;. Each node can only be passed at least once.<p>Should be:<p>&gt; Each node can only be passed at most once.
评论 #29326844 未加载
3npover 3 years ago
Is “mesh” in this context a term I’m not aware of? The author never defines it.<p>My guess is that “mesh” here is supposed to mean “directed cyclic graph” but it’s not very clear.