Note that there are some explanatory texts on larger screens.

plurals
  1. PO(Set of) List of sets (Cartesian product(s)) from graph corresponding to set of lists
    primarykey
    data
    text
    <p>The set of lists (A):</p> <pre><code>{[a,b,d,f], [a,c,d,f], [a,b,e,f], [a,c,e,f]} </code></pre> <p>where a, b, c, d, e and f are items (not necessarily characters in a word), can be factored as a directed acyclic graph (DAG, B, all edges point from left -> to right):</p> <pre><code> b--&gt;d / \ / \ a X f \ / \ / c--&gt;e </code></pre> <p>or as the Cartesian product of 4 sets of items (C, termed axes):</p> <pre><code>{a} * {b,c} * {d, e} * {f} </code></pre> <p>Guava has a nice <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/Sets.html#cartesianProduct%28java.util.List%29" rel="nofollow noreferrer"><em>method</em></a> for generating a set of lists (A) from a list of sets (C).</p> <p>I am trying for an algorithm that accepts a graph like B and returns a list of axes like C (actually one or more, see example below), which can be used with the method above to generate a set of lists like A.</p> <p>However, it is not guaranteed that the set of lists will be a Cartesian product. For example:</p> <pre><code>{[a,b,d,f], -missing- [a,b,e,f], [a,c,e,f]} </code></pre> <p>corresponding to the DAG:</p> <pre><code> b--&gt;d / \ \ a \ f \ \ / c--&gt;e </code></pre> <p>cannot be expressed as <strong>1</strong> Cartesian product but can be expressed as 2:</p> <pre><code>{a}*{b}*{d,e}*{f} and {a}*{c}*{e}*{f} </code></pre> <p>corresponding to the graphs:</p> <pre><code> d / \ a--&gt;b f and a--&gt;c--&gt;e--&gt;f \ / e </code></pre> <p>The lists should have some degree of relatedness (think: a random sample of a very large Cartesian product).</p> <p>Note: lists of different lengths cannot share the same set of axes.</p> <p>Is there an algorithm that does this and I just haven't Googled the right terms? If not, can we create it?</p> <p>Complexity of the algorithm may be an issue as the set could have 10^2 lists and each list could have 10^2 of items, i.e. a fairly large graph. I can guarantee that the input graphs would have the minimal number of nodes possible to represent the set of lists..., and that connected non-branching nodes (a->c->e->f) can be rolled up into single objects (acef).</p> <p>PS. I don't think this is same as the <a href="http://en.wikipedia.org/wiki/Cartesian_product_of_graphs" rel="nofollow noreferrer">Cartesian product of graphs</a>, but there could be some overlap.</p>
    singulars
    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