Run Graph Algorithms

The Algorithm panel provides a library of algorithms widely used to analyze patterns of graph connection. Algorithms are organized into Path Finding, Centrality and Community Detection tabs.

  • Path Finding traces the path between a set of selected start and end nodes, and can apply an optional weight based on a relationship property.

  • Centrality and Community Detection algorithms evaluate each node in the graph and return a numerical measure of its connectedness or grouping.

For an e-book introduction to graph algorithms and their uses, see Graph Algorithms: Practical Examples in Apache Spark and Neo4j.

Path Finding

Path Finding traces the shortest path between selected start and end nodes. You can weight the path using a numerical property of relationships in the path as a weighting factor. The nodes and edges on the path are traced and selected.

Once a path is traced, you can click Spotlight Path to display only its nodes and edges.

To find a path between connected nodes:

  1. Open the Algorithm panel and Path Finding tab.

    07 00 01 AlgorithmPanel
  2. Select one or more starting nodes in the graph, and click Add to Start.
    Your selected nodes are listed in Start Nodes.

    An error message displays if you select too many start and end nodes such that there are more than ten pairs for tracing the shortest path.
  3. Now select ending nodes in the graph, and click Add to End. The selected nodes are listed in End Nodes.

    You can click Remove Start Node or Remove End Node to delete your current selection and choose other nodes.
  4. In the Weight Property menu you can select a property of one of the relationships in the path to be used as a path weighting value, or leave the default Ignore Weight Property selected. If the relationships have no properties (which is often the case), Ignore Weight Property will be the only choice.

  5. Click Trace Path to display and select the nodes and edges for the shortest path(s) between your start and end nodes.

    07 01 01 AlgorithmPath
  6. Click Spotlight Path to display only the nodes and edges in the path. The button label changes to Un-spotlight Path.

    07 01 02 AlgorithmSpotlight
  7. At this point, you can tag the path, and save the tag as a property so that you can easily find it again. You may also want to save and share a data View, export a GXRF file, or save and export a Snapshot.

    07 01 03 PathTag
  8. Click Un-spotlight Path to deselect the path and return the all the data to the graph. The start and end nodes persist in the Path Finding tab until you remove them, so you can click Trace Path again.

For a path with a single start and end node, select the two nodes, then right-click and select Find Path. This might be faster than using the Path Finding algorithm. To isolate (i.e. spotlight) the resulting path, select Inverse, then Hide Selection. You can now tag the path and/or save the view.

Centrality or Community Detection

GraphXR includes a library of commonly used Centrality or Community Detection algorithms, which calculate measures of connectedness (both with respect to distance and strength of connection) in multi-dimensional data. There are many such algorithms, and each has its own characteristic behavior and strengths.

When you run a Centrality or Community Detection algorithm the computed result is added as a property and its value to each node in the graph. The property values can be displayed (for example, in a scatter plot or geometric layout), accessed for other processes within GraphXR, or exported to other graph analytics or statistics applications.

The following table lists the available algorithms and the property names GraphXR uses for the results.

Algorithm Type Algorithm Property Name

Centrality

PageRank

pageRank

Centrality

Betweenness

betweenness

Centrality

Closeness

closeness

Centrality

Eigenvector

eigenvector

Community Detection

Connected Component

componentId

Community Detection

Strong Connected Component

strongComponentId

Community Detection

Louvain

louvainComponentId

Community Detection

Label Propagation

labelPropagationId

To run a Centrality or Community Detection algorithm:

  1. In the Algorithm panel, click to open the Centrality or Community Detection tab.

    07 01 04 Centrality
  2. Click the button for the algorithm you want to run.

    A message displays when the calculation is finished. The property and calculated value is added to each node in the graph. To review the results, you can:

    • Open a table.

      07 01 05 AlgorithmResultsTable

      OR

    • Inspect any node’s information panel.

      07 01 06 CommunityDetectionInfo