title: Shortest Path between nodes of some specific type and destination node
body: <p>Say I want to find the shortest path between some node of a specific type (say &quot;central production unit&quot;) and a defined end node (say &quot;consumer&quot; with an id), how to I calculate this in Neo4j with Cypher?</p>
  <p>With such queries i'd like to answer questions like: &quot;Which production unit feeds this customer with the shortest distance&quot;.</p>
  <p>I tried with queries like:</p>
  <pre><code>match p=AllShortestPaths((source:Asset)-[:LINKS_TO*]-(destination:Asset))
  where source.type = 'central production unit' and destination.id = '1234'
  return  extract(n in nodes(p)| n.type) as type_path,
          extract(n in nodes(p)| n.id) as id_path,
          length(p) as path_length;
  </code></pre>
  <p>queries like the one above will run into an out of memory error.</p>
  <p>Using the same query but instead of a <strong>type</strong> of node, entering a specific <strong>id</strong> works perfectly fine.</p>
  <p>Sniffing around on Stackoverflow i've found ceveral examples of 1 specific node to 1 other specific node, but not 1 yet to determine node of a certain type to 1 specific node.</p>