Note that there are some explanatory texts on larger screens.

plurals
  1. PODiGraph: Nearest node that joins all paths
    primarykey
    data
    text
    <h3>Some background</h3> <p>I'm analyzing the control flow graph of a function which basically maps incoming data onto outgoing data. Most of the blocks are like this one:</p> <pre class="lang-c prettyprint-override"><code>if (input_variable == SPECIFIC_CONSTANT) { output_variable = TRUE; } else { output_variable = FALSE; } </code></pre> <p>Typical Control Flow Graph for such code looks like the following graph</p> <pre><code>digraph G { 2 -&gt; 3 -&gt; 5; 2 -&gt; 4 -&gt; 5; } </code></pre> <p><a href="http://i.imgur.com/q7Pu2ja.png">Picture of the graphe</a></p> <p>where execution of <code>3</code> and <code>4</code> are conditioned by the value of the <code>input_variable</code> but <code>5</code> is independent.</p> <h3>The question</h3> <p>Given a directed graph and a start node, how do I find the nearest node such that any path from the start node goes through this node?</p> <p><em>Example: Given <a href="http://i.imgur.com/gjLVlQX">this graph</a> how do I find <code>6</code> starting from <code>2</code> or <code>12</code> starting from <code>8</code>?</em></p> <p>Can I reverse a Lowest Common Ancestor algorithm and would it be efficient? Like</p> <pre><code>for each node in graph: ancestors = node.get_all_ancestors() lca = find_lowest_common_ancestor(ancestors) junction_node[lca] = node get_junction_point(node): return junction_node[node] </code></pre> <p>My programming language is Python and I just discovered NetworkX, but any algorithm would be appreciated. I am not accustomed to graph theory and I think I miss the basic glossary to find what I'm looking for.</p> <p>Thanks for your help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload