title: neo4j: Is there a way/how to select random nodes?
body: <p>I would like to retrieve a specific number of random nodes. The graph consists of 3 000 000 nodes where some of them are sources, some are target and some are both.</p>
  
  <p>The aim is to retrieve random sources and as I don't know how to select random, the program generates k random numbers from 1 to 3 000 000 which represent node IDs and then discards all randomly selected nodes that are not sources. As this procedure is time-consuming, I wonder whether it is possible to directly select random sources with cypher query.</p>
  
  <p>In case to select all sources, the query would be the following</p>
  
  <pre><code>START t=node(*) MATCH (a)-[:LEADS_TO]-&gt;(t) RETURN a
  </code></pre>
  
  <p>Does anyone know how would it be possible to select the limited number of random nodes directly with a cypher or, if not possible, suggest any workaround?</p>