Note that there are some explanatory texts on larger screens.

plurals
  1. POAlgorithm for Least Edge Intersections
    primarykey
    data
    text
    <p>(Before anyone asks, it's not homework.)</p> <p>Say you have 2 Arrays <code>y0</code> and <code>y1</code> where</p> <p><code>y0 = [1,2,3,4,5,6]</code> and <code>y1 = [2,1,6,3,4,5]</code></p> <p>Notice <code>y0[0] = y1[1] = 1</code>, it essentially means <code>y0[0]</code> is connected to <code>y1[1]</code>. Similarly, <code>y0[2] = y1[3] = 3</code> so they are "connected" as well. </p> <p><img src="https://i.stack.imgur.com/wYkkr.png" alt="alt text"><em>(Image courtesy : belisarius)</em></p> <p>Each element in one array has a corresponding entry in the second array. <em>Imagine each element in the array as a <strong>vertex</strong>, and these connections as <strong>Edges</strong> being drawn from one array to the other.</em></p> <p>I need to find a set of <strong>edges</strong> (of maximum size) such that none of the "edges" (or lines) will intersect.</p> <p>In the above example, notice,</p> <ol> <li><code>Edge 1</code> and <code>Edge 2</code> will intersect. </li> <li><code>Edge 6</code> will intersect with <code>Edge 3, Edge 4, Edge 5</code>.</li> </ol> <p>Therefore, the solution can be be <code>1,3,4,5</code> or <code>2,3,4,5</code> (size = 4) since none of those lines will intersect each other. There can be multiple solutions, but I need just one.</p> <p>My Question, Is there any known CS Problem that resembles this? What algorithm should i be using?</p> <p>I've tried to explain my problem with an example, however, incase it's still not clear i'll clarify any queries. Thanks in advance.</p>
    singulars
    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.
    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