-
Notifications
You must be signed in to change notification settings - Fork 5
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
Algorithms section & degree docs #117
Open
swilly22
wants to merge
5
commits into
main
Choose a base branch
from
degree
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,3 +347,4 @@ hostnames | |
bigmac | ||
calmcode | ||
io | ||
influencers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Degree Procedure Documentation | ||
|
||
## Introduction | ||
|
||
The **Degree Procedure** calculates the degree of nodes in a graph based on the specified parameters. | ||
This allows users to analyze the connectivity of nodes in terms of incoming or outgoing edges, filtered by node labels and relationship types. | ||
|
||
--- | ||
|
||
## Use Cases | ||
|
||
Here are some practical scenarios where the **Degree Procedure** can be applied: | ||
|
||
1. **Social Network Analysis**: Identify influencers or highly connected individuals by calculating the degree of `Person` nodes in a social graph. | ||
2. **Infrastructure Planning**: Determine bottlenecks in a transportation network by analyzing nodes with high incoming or outgoing connections. | ||
3. **E-commerce Recommendations**: Identify popular products or categories by computing the degree of `Product` or `Category` nodes based on customer interactions. | ||
4. **Fraud Detection**: Spot suspicious activities by analyzing nodes with unusually high degrees in financial transaction graphs. | ||
|
||
--- | ||
|
||
## Syntax | ||
|
||
```plaintext | ||
CALL algo.degree(config) | ||
``` | ||
|
||
### Parameters | ||
|
||
The `config` parameter is a Map object containing the following optional keys: | ||
|
||
| Key | Type | Default | Description | | ||
| ------------- | ------ | ---------- | ---------------------------------------------------------------------- | | ||
| `source` | String | `null` | Specifies the label of nodes for which the degree is computed. | | ||
| `dir` | String | `outgoing` | Direction of edges to consider: `incoming` or `outgoing`. | | ||
| `relation` | String | `null` | Specifies the type of edges to consider. | | ||
| `destination` | String | `null` | Specifies the label of nodes reachable via the edges being considered. | | ||
|
||
--- | ||
|
||
## Output | ||
|
||
The procedure returns a result set where each row corresponds to a node and includes the following fields: | ||
|
||
| Field | Type | Description | | ||
| -------- | ---- | -------------------------------- | | ||
| `node` | Node | The Node object. | | ||
| `degree` | Int | The computed degree of the node. | | ||
|
||
--- | ||
|
||
## Setting Up the Graph | ||
|
||
To run the examples below, create the following graph structure: | ||
|
||
### Nodes: | ||
|
||
| ID | Label | | ||
| -- | ------ | | ||
| 1 | Person | | ||
| 2 | Person | | ||
| 3 | City | | ||
| 4 | City | | ||
|
||
### Relationships: | ||
|
||
| Source | Target | Type | | ||
| ------ | ------ | ------- | | ||
| 1 | 2 | FRIEND | | ||
| 1 | 3 | VISITED | | ||
| 2 | 3 | VISITED | | ||
| 2 | 4 | VISITED | | ||
|
||
Create this graph using the following commands: | ||
|
||
```plaintext | ||
CREATE (:Person {id: 1}) | ||
CREATE (:Person {id: 2}) | ||
CREATE (:City {id: 3}) | ||
CREATE (:City {id: 4}) | ||
CREATE (p1:Person {id: 1})-[:FRIEND]->(p2:Person {id: 2}) | ||
CREATE (p1)-[:VISITED]->(c1:City {id: 3}) | ||
CREATE (p2)-[:VISITED]->(c1) | ||
CREATE (p2)-[:VISITED]->(c2:City {id: 4}) | ||
``` | ||
|
||
--- | ||
|
||
## Examples and Results | ||
|
||
### Example 1: Compute the outgoing degree for all nodes | ||
|
||
```plaintext | ||
CALL algo.degree({}) | ||
``` | ||
|
||
#### Result: | ||
|
||
| Node | Degree | | ||
| ---- | ------ | | ||
| 1 | 2 | | ||
| 2 | 3 | | ||
| 3 | 0 | | ||
| 4 | 0 | | ||
|
||
--- | ||
|
||
### Example 2: Compute the outgoing degree for specific node types | ||
|
||
```plaintext | ||
CALL algo.degree({source: 'Person'}) | ||
``` | ||
|
||
#### Result: | ||
|
||
| Node | Degree | | ||
| ---- | ------ | | ||
| 1 | 2 | | ||
| 2 | 3 | | ||
|
||
--- | ||
|
||
### Example 3: Compute the outgoing degree for a specific relationship type | ||
|
||
```plaintext | ||
CALL algo.degree({source: 'Person', relation: 'FRIEND', dir: 'outgoing'}) | ||
``` | ||
|
||
#### Result: | ||
|
||
| Node | Degree | | ||
| ---- | ------ | | ||
| 1 | 1 | | ||
|
||
--- | ||
|
||
### Example 4: Compute the incoming degree for reachable nodes of a specific type | ||
|
||
```plaintext | ||
CALL algo.degree({source: 'Person', relation: 'VISITED', dir: 'incoming', destination: 'City'}) | ||
``` | ||
|
||
#### Result: | ||
|
||
| Node | Degree | | ||
| ---- | ------ | | ||
| 3 | 2 | | ||
| 4 | 1 | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: "Graph Algorithms" | ||
description: Graph Algorithms | ||
nav_order: 4 | ||
has_children: true | ||
--- | ||
|
||
# FalkorDB Algorithms Documentation | ||
|
||
Welcome to the FalkorDB Algorithms Documentation! This guide provides an overview of all algorithms available within FalkorDB, enabling powerful graph analytics and insights. Each algorithm is designed to help you process and analyze graph data efficiently for a variety of use cases. | ||
|
||
## Available Algorithms | ||
|
||
Below is the list of supported algorithms in FalkorDB. Click on an algorithm to view its detailed documentation, including syntax, examples, and practical use cases: | ||
|
||
### Traversal Algorithms | ||
- [BFS](algorithms/BFS) | ||
- Performs a Breadth-First Search traversal of the graph. | ||
|
||
### Centrality Algorithms | ||
- [PageRank](algorithms/page_rank) | ||
- Measures the importance of nodes based on incoming connections. | ||
|
||
### Connectivity Algorithms | ||
- [Degree](algorithms/degree) | ||
- Calculates the degree of nodes, focusing on connectivity based on edge direction and type. | ||
|
||
### Pathfinding Algorithms | ||
- [Shortest Path](algorithms/shortest_path) | ||
- Finds the shortest path between two nodes. | ||
|
||
### Community Detection Algorithms | ||
- [Label Propagation](algorithms/label_propagation) | ||
- Identifies communities based on label diffusion through the graph. | ||
|
||
--- | ||
|
||
## Getting Started | ||
|
||
To begin using any of the algorithms: | ||
1. Ensure FalkorDB is installed and running. | ||
2. Load your graph data into FalkorDB. | ||
3. Refer to the detailed documentation for each algorithm to configure and execute it. | ||
|
||
For example, to calculate node degrees: | ||
|
||
```plaintext | ||
CALL algo.degree({}) | ||
``` | ||
|
||
--- | ||
|
||
## Feedback and Contributions | ||
|
||
We welcome feedback and contributions! If you encounter issues or have suggestions for new algorithms, please visit our [GitHub repository](https://github.com/FalkorDB/FalkorDB). | ||
|
||
Happy graph analytics with FalkorDB! | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "Client Libraries" | ||
nav_order: 4 | ||
nav_order: 5 | ||
description: > | ||
FalkorDB Clients | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Building Docker | ||
nav_order: 6 | ||
nav_order: 8 | ||
description: "Building docker container examples" | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "Operations" | ||
nav_order: 10 | ||
nav_order: 12 | ||
description: "Configuring FalkorDB Docker" | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💡 Codebase verification
Documentation structure is broken and inconsistent
The following documentation links are broken:
algorithms/BFS
- directory doesn't existalgorithms/page_rank
- directory doesn't existalgorithms/shortest_path
- directory doesn't existalgorithms/label_propagation
- directory doesn't existAdditionally, there's an inconsistency where
degree
is documented in a flat file (algorithms/degree.md
) while others use a directory-based approach in the navigation.🔗 Analysis chain
Verify algorithm documentation links.
The links appear to be relative paths. Let's ensure they point to valid documentation files.
Note: 'Pathfinding' flagged by the spellchecker is a correct technical term and can be safely added to the dictionary.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 638
Script:
Length of output: 1111
🧰 Tools
🪛 GitHub Actions: spellcheck
[error] Spelling errors found: 'analytics' (appears twice)
[error] Spelling error found: 'Pathfinding'