UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
  • 1. Install & Connect
  • 2. Load Your Data
  • 3. Query Your Data
  • 4. Run Graph Algorithms
  • 5. Work with an AI Agent
  • 6. Next Steps
  1. Docs
  2. /
  3. Quick Start

4. Run Graph Algorithms

Beyond retrieving data, GQLDB ships a library of built-in graph algorithms for centrality, community detection, similarity, pathfinding, embeddings, and more. They answer structural questions that are hard to express as plain queries, like "who is most influential?" or "which users cluster together?".

For a full algorithm directory, see Graph Algorithms.

Rank by Degree

The simplest centrality measure is degree: how many edges a node has. Every algorithm is invoked with CALL algo.<name>(), and YIELD names the columns it produces. Since Follows edges point from follower to followee, each user's follower count is their in-degree:

GQL
CALL algo.degree({direction: "in", order: "desc"}) YIELD nodeId, degree
RETURN nodeId, degree
ORDER BY degree DESC

User with the _id as u1 comes out on top with a degree of 6 (six followers). Use direction: "out" for how many people each user follows, or both to ignore direction.

To get the name of the users and their follower count:

GQL
CALL algo.degree({direction: "in", order: "desc"}) YIELD nodeId, degree
MATCH (n) WHERE n._id = nodeId
RETURN n.name, degree
ORDER BY degree DESC

Rank by Influence with PageRank

Degree counts every follower equally. PageRank goes further, weighting a follow more heavily when it comes from an already-influential user, so it propagates influence along incoming edges. Get the top users by influence, with their names:

GQL
CALL algo.pagerank() YIELD nodeId, score
MATCH (n) WHERE n._id = nodeId
RETURN n.name, score
ORDER BY score DESC

Because Follows edges point from follower to followee, a high PageRank marks a user that many well-connected users follow.


You can now install, load, query, and analyze. Last stop: hand the whole thing to an AI agent. Work with an AI Agent.