Skip to content

Instantly share code, notes, and snippets.

@rjurney
Last active December 27, 2024 05:12
Show Gist options
  • Save rjurney/4f8041f09884d841815bd025f6f5c317 to your computer and use it in GitHub Desktop.
Save rjurney/4f8041f09884d841815bd025f6f5c317 to your computer and use it in GitHub Desktop.
Github Copilot can do network motifs...
We can also look for a more complex motif: a directed square. We will find all instances of a directed square in the graph.
<div data-lang="python" markdown="1">
{% highlight python %}
# G8: Directed Square
paths = g.find("(a)-[e]->(b); (b)-[e2]->(c); (c)-[e3]->(d); (d)-[e4]->(a)")
four_edge_count(paths).show()
{% endhighlight %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment