Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def mutate(
node_filter : str
A Cypher predicate for filtering nodes in the input graph.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -78,7 +78,7 @@ def write(
node_filter : str
A Cypher predicate for filtering nodes in the input graph.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def stream(
concurrency : Optional[Any], default=None
The number of concurrent threads
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -89,7 +89,7 @@ def write(
write_concurrency : Optional[Any], default=None
The number of concurrent threads used for writing
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -130,7 +130,7 @@ def drop(
concurrency : Optional[Any], default=None
The number of concurrent threads
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def stream(
concurrency : Optional[Any], default=None
The number of concurrent threads
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -81,7 +81,7 @@ def write(
write_concurrency : Optional[Any], default=None
The number of concurrent threads used for writing
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -146,7 +146,7 @@ def index_inverse(
concurrency : Optional[Any], default=None
The number of concurrent threads
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -192,7 +192,7 @@ def to_undirected(
concurrency : Optional[Any], default=None
The number of concurrent threads
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def generate(
job_id : Optional[str], default=None
Unique identifier for the job associated with the graph generation.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress during graph generation.
username : Optional[str], default=None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def stream(
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def mutate(
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -80,7 +80,7 @@ def stats(
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -120,7 +120,7 @@ def stream(
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down Expand Up @@ -168,7 +168,7 @@ def write(
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
username : Optional[str], default=None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

from graphdatascience.procedure_surface.api.base_result import BaseResult
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2

from graphdatascience.procedure_surface.api.estimation_result import EstimationResult


class BetweennessEndpoints(ABC):

@abstractmethod
def mutate(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

from graphdatascience.procedure_surface.api.base_result import BaseResult
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2

from graphdatascience.procedure_surface.api.estimation_result import EstimationResult


class PageRankEndpoints(ABC):

@abstractmethod
def mutate(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@


class K1ColoringEndpoints(ABC):
"""
Abstract base class defining the API for the K-1 Coloring algorithm.
"""

@abstractmethod
def mutate(
Expand All @@ -31,32 +28,35 @@ def mutate(
job_id: Optional[Any] = None,
) -> K1ColoringMutateResult:
"""
Executes the K-1 Coloring algorithm and writes the results to the in-memory graph as node properties.
Runs the K-1 Coloring algorithm and stores the results in the graph catalog as a new node property.

The K-1 Coloring algorithm assigns a color to every node in the graph, trying to optimize for two objectives:
to make sure that every neighbor of a given node has a different color than the node itself, and to use as few colors as possible.

Parameters
----------
G : GraphV2
The graph to run the algorithm on
mutate_property : str
The property name to store the color for each node
Name of the node property to store the results in.
batch_size : Optional[int], default=None
The batch size for processing
max_iterations : Optional[int], default=None
The maximum number of iterations of K-1 Coloring to run
Maximum number of iterations to run.
relationship_types : Optional[List[str]], default=None
The relationships types used to select relationships for this algorithm run
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
Display progress logging.
username : Optional[str], default=None
The username to attribute the procedure run to
As an administrator, run the algorithm as a different user, to access also their graphs.
concurrency : Optional[Any], default=None
The number of concurrent threads
Number of CPU threads to use.
job_id : Optional[Any], default=None
An identifier for the job
Identifier for the computation.

Returns
-------
Expand Down
24 changes: 14 additions & 10 deletions graphdatascience/procedure_surface/api/community/kcore_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,32 @@ def mutate(
job_id: Optional[Any] = None,
) -> KCoreMutateResult:
"""
Executes the K-Core algorithm and writes the results to the in-memory graph as node properties.
Runs the K-Core Decomposition algorithm and stores the results in the graph catalog as a new node property.

The K-core decomposition constitutes a process that separates the nodes in a graph into groups based on the degree sequence and topology of the graph.
The term `i-core` refers to a maximal subgraph of the original graph such that each node in this subgraph has degree at least `i`.
Each node is associated with a core value which denotes the largest value `i` such that the node belongs to the `i-core`.

Parameters
----------
G : GraphV2
The graph to run the algorithm on
mutate_property : str
The property name to store the core value for each node
Name of the node property to store the results in.
relationship_types : Optional[List[str]], default=None
The relationships types used to select relationships for this algorithm run
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
Display progress logging.
username : Optional[str], default=None
The username to attribute the procedure run to
As an administrator, run the algorithm as a different user, to access also their graphs.
concurrency : Optional[Any], default=None
The number of concurrent threads
job_id : Optional[Any], default=None
An identifier for the job
Number of CPU threads to use.
job_id : Optional[Any] = None
Identifier for the computation.

Returns
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,46 @@ def mutate(
relationship_weight_property: Optional[str] = None,
) -> LouvainMutateResult:
"""
Executes the Louvain algorithm and writes the results to the in-memory graph as node properties.
Runs the Louvain algorithm and stores the results in the graph catalog as a new node property.

The Louvain method is an algorithm to detect communities in large networks.
It maximizes a modularity score for each community, where the modularity quantifies the quality of an assignment of nodes to communities by evaluating how much more densely connected the nodes within a community are, compared to how connected they would be in a random network.
The Louvain algorithm is a hierarchical clustering algorithm that recursively merges communities into a single node and runs the modularity clustering on the condensed graphs.

Parameters
----------
G : GraphV2
The graph to run the algorithm on
mutate_property : str
The property name to store the community ID for each node
Name of the node property to store the results in.
tolerance : Optional[float], default=None
The tolerance value for the algorithm convergence
Minimum change in scores between iterations.
max_levels : Optional[int], default=None
The maximum number of levels in the hierarchy
include_intermediate_communities : Optional[bool], default=None
Whether to include intermediate community assignments
Whether to include intermediate communities
max_iterations : Optional[int], default=None
The maximum number of iterations per level
Maximum number of iterations to run.
relationship_types : Optional[List[str]], default=None
The relationships types used to select relationships for this algorithm run
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
Display progress logging.
username : Optional[str], default=None
The username to attribute the procedure run to
As an administrator, run the algorithm as a different user, to access also their graphs.
concurrency : Optional[Any], default=None
The number of concurrent threads
Number of CPU threads to use.
job_id : Optional[Any], default=None
An identifier for the job
Identifier for the computation.
seed_property : Optional[str], default=None
Defines node properties that are used as initial community identifiers
The property name that contains seed values
consecutive_ids : Optional[bool], default=None
Flag to decide whether community identifiers are mapped into a consecutive id space
Whether to use consecutive IDs
relationship_weight_property : Optional[str], default=None
The property name that contains weight
Name of the property to be used as weights.

Returns
-------
Expand Down
23 changes: 13 additions & 10 deletions graphdatascience/procedure_surface/api/community/scc_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,33 @@ def mutate(
consecutive_ids: Optional[bool] = None,
) -> SccMutateResult:
"""
Executes the SCC algorithm and writes the results to the in-memory graph as node properties.
Runs the Strongly Connected Components algorithm and stores the results in the graph catalog as a new node property.

The Strongly Connected Components (SCC) algorithm finds maximal sets of connected nodes in a directed graph.
A set is considered a strongly connected component if there is a directed path between each pair of nodes within the set.

Parameters
----------
G : GraphV2
The graph to run the algorithm on
mutate_property : str
The property name to store the component ID for each node
Name of the node property to store the results in.
relationship_types : Optional[List[str]], default=None
The relationships types used to select relationships for this algorithm run
Filter the graph using the given relationship types. Relationships with any of the given types will be included.
node_labels : Optional[List[str]], default=None
The node labels used to select nodes for this algorithm run
Filter the graph using the given node labels. Nodes with any of the given labels will be included.
sudo : Optional[bool], default=None
Override memory estimation limits
Disable the memory guard.
log_progress : Optional[bool], default=None
Whether to log progress
Display progress logging.
username : Optional[str], default=None
The username to attribute the procedure run to
As an administrator, run the algorithm as a different user, to access also their graphs.
concurrency : Optional[Any], default=None
The number of concurrent threads
Number of CPU threads to use.
job_id : Optional[Any], default=None
An identifier for the job
Identifier for the computation.
consecutive_ids : Optional[bool], default=None
Flag to decide whether component identifiers are mapped into a consecutive id space
Whether to use consecutive IDs for components

Returns
-------
Expand Down
Loading