Graph Search in cuGraph (GPU):

  • bfs: Breadth-First Search - finds the shortest path based on edge count.
  • bfs_edges: Executes a breadth-first search over specified edges.
  • sssp: Single Source Shortest Path - determines the shortest path from a given starting node.
  • shortest_path: Identifies the shortest path from a source node to all other nodes.
  • shortest_path_length: Computes the shortest distance from the source to all other nodes.
  • minimum_spanning_tree: Produces the minimum spanning tree for a connected graph.
  • Gomory_hu_tree: Forms the Gomory-Hu tree, which is utilized for maximum flow calculations.

Graph Search in igraph (CPU):

  • betweenness: Betweenness centrality of vertices and edges in a graph.
  • shortest_paths: (As an alternative to shortest_path in cuGraph) Computes shortest paths from/to one vertex or between vertex pairs.
  • get_shortest_paths: Retrieves the actual path (and not just the distance) from one vertex to another.
  • spanning_tree: (As an alternative to minimum_spanning_tree in cuGraph) Determines a spanning tree of the graph using Kruskal's algorithm.

Advanced Graph Search with chain():

The chain() function from pygraphistry provides a powerful and flexible way to filter or apply operations on nodes and edges of a graph. This functionality is similar in expressive power to the Cypher graph pattern matching system, commonly used in graph databases like Neo4j. This similarity allows for complex and nuanced graph queries and transformations. Here are some ways you can harness this functionality:

      Ensure the necessary functions are imported:

      from graphistry.compute.ast import n, e_forward, e_reverse, e_undirected
    • Basic Chain: An empty chain operation which has no effect on the graph.
      g2 = g.chain([])
    • Node Filters: Filtering nodes based on certain attributes.
      g2 = g.chain([n({"node": "a", "type": "n"})])
    • Edge Filters: Various ways to filter edges, be it directed (forward or reverse) or undirected.
      • Undirected:
        g2 = g.chain([e_undirected({})])
      • Directed (forward):
        g2 = g.chain([e_forward({g._source: "j"})])
      • Directed (reverse):
        g2 = g.chain([e_reverse({g._destination: "b"})])
    • Chaining Multiple Operations: Combining multiple operations.
      
      g2 = g.chain([
          n({g._node: "e"}),
          e_forward({}, hops=2),
      ])
              
    • Named Chains: Naming specific operations in the chain for clarity.
      
      g2 = g.chain([
          n({g._node: "e"}, name="n1"),
          e_forward({}, hops=1),
          e_forward({}, hops=1, name="e2"),
          n(name="n2"),
      ])