title: Special nested query in LINQ
body: <p>I'm writting a graph algorithm and I'm almost there...</p>
  
  <p>My algorithm stores several edge objects in a collection of edges, representing a path from initial vertex to final vertex. Thus, there should be also several paths between those vertexes (several collections of edge type), stored in another collection (in my class, callded "collswap").</p>
  
  <p>Each edge is an object which have two vertexes: initial (v) and final (w), in this way:</p>
  
  <pre><code>dim manhattan as new vertex
  dim brooklyn as new vertex
  dim statenIsland as new vertex
  
  dim brooklynBridge as new edge(brooklyn, manhattan)
  dim route278 as new edge(statenIsland, brooklyn)
  
  'calculates the path and stores the collections in a private property 'collswap'
  me.returnPath(statenIsland, manhattan)
  
  'in me.collswap (type collection) I have one collection (type 'system.collections.generic.list(of edge)) with two edges (route278 and brooklynBridge)
  </code></pre>
  
  <p>The graph is correctly calculated, but now I have to pick the best path. So, I need to query collswap in ways of:</p>
  
  <ol>
  <li><p>Retrieving only those paths which last edge contains the desired vertex in vertexW property
  ex: brooklynBridge.vertexW 'retrieves manhattan vertex (because my code can store a path which don't reaches the final vertex)</p></li>
  <li><p>Selecting the minor path between various located (the fewer ellements collection)</p></li>
  </ol>
  
  <p>Would you help-me to build a good (and ellegant) Linq query to carry out these tasks?</p>
  
  <p>Thank you!</p>