-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Leiden community detection algorithm docs #1014
base: memgraph-2-21
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -30,6 +30,7 @@ library](/advanced-algorithms/install-mage). | |||
| [bipartite_matching](/advanced-algorithms/available-algorithms/bipartite_matching) | C++ | Algorithm for calculating maximum bipartite matching, where matching is a set of nodes chosen in such a way that no two edges share an endpoint. | | |||
| [bridges](/advanced-algorithms/available-algorithms/bridges) | C++ | A bridge is an edge, which when deleted, increases the number of connected components. The goal of this algorithm is to detect edges that are bridges in a graph. | | |||
| [community_detection](/advanced-algorithms/available-algorithms/community_detection) | C++ | The Louvain method for community detection is a greedy method for finding communities with maximum modularity in a graph. Runs in _O_(*n*log*n*) time. | | |||
| [leiden_community_detection](/advanced-algorithms/available-algorithms/leiden_community_detection) | C++ | The Leiden method for community detection is an improvement on the Louvain method, designed to find communities with maximum modularity in a graph while addressing issues of disconnected communities. Runs in _O_(*L* *m*) time, where *L* is the number of iterations of the algorithm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in alphabetical order
{<h4> Input: </h4>} | ||
|
||
- `subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run. | ||
- `weight: string (default=null)` ➡ Specifies the default relationship weight. If not set, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a string and not a float? Does it refer to a property name?
|
||
- `subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run. | ||
- `weight: string (default=null)` ➡ Specifies the default relationship weight. If not set, | ||
the algorithm uses the `weight` relationship attribute when present and otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relationship implies "edge". Is that what you meant?
- `weight: string (default=null)` ➡ Specifies the default relationship weight. If not set, | ||
the algorithm uses the `weight` relationship attribute when present and otherwise | ||
treats the graph as unweighted. | ||
- `gamma: double (default=1.0)` ➡ Resolution parameter used when computing the modularity. Internally the value is divided by the number of relationships for an unweighted graph, or the sum of weights of all relationships otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is gamma divided by some kind of weight? Please explain.
|
||
{<h4> Output: </h4>} | ||
|
||
- `node: Vertex` ➡ Graph node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we give this a more descriptive label? What is special about this single node that is returned? Is it some kind of centroid for the community?
|
||
{<h4> Input: </h4>} | ||
|
||
- `subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the algorithm behave when subgraph is NOT provided?
|
||
- `node: Vertex` ➡ Graph node. | ||
- `community_id: integer` ➡ Community ID. Defaults to $-1$ if the node does not belong to any community. | ||
- `communities: list` ➡ List of intermediate communities that a node has been part of across iterations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this indicate the community hierarchy?
|
||
### `get_subgraph()` | ||
|
||
Computes graph communities over a subgraph using the Louvain method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is Louvain on the Leiden page? I'm confused.
```cypher | ||
CALL leiden_community_detection.get() | ||
YIELD node, community_id, communities | ||
RETURN node.id AS node_id, community_id, communities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to see an example where a node is a member of more than one hierarchical community
- `subgraph: Graph` (**OPTIONAL**) ➡ A specific subgraph, which is an [object of type Graph](/advanced-algorithms/run-algorithms#run-procedures-on-subgraph) returned by the `project()` function, on which the algorithm is run. | ||
- `subgraph_nodes: List[Node]` ➡ List of nodes in the subgraph. | ||
- `subgraph_relationships: List[Relationship]` ➡ List of relationships in the subgraph. | ||
- `weight: string (default=null)` ➡ Specifies the default relationship weight. If not set, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does leiden require the --storage-properties-on-edges=true configuration?
Description
Add Leiden community detection algorithm docs to the available Mage algorithms.
Pull request type
Please check what kind of PR this is:
Related PRs and issues
PR this doc page is related to:
memgraph/mage#508
Checklist: