PregelEx (PregelEx v0.1.3)
View SourcePregelEx - A Pregel-like graph processing framework for Elixir.
Supports multiple graphs with vertices that can perform distributed computation. Each graph runs as a separate supervisor tree with fault tolerance.
Summary
Functions
Clears all outgoing messages for a vertex in the specified graph.
Computes a vertex in the specified graph.
Creates an edge between two vertices in a graph.
Creates a new graph with the given ID.
Creates a vertex in the specified graph.
Executes a superstep for the given graph.
Gets the count of active graphs.
Gets the count of vertices in a graph.
Gets all outgoing edges for a vertex.
Gets all neighbor vertex IDs for a vertex.
Gets the state of a vertex in a graph.
Lists all edges in the graph.
Lists all active graphs.
Lists all vertices in a graph.
Removes an edge between two vertices.
Sends a message from one vertex to another in the specified graph.
Stops a graph and all its vertices.
Stops a vertex in the specified graph.
Functions
Clears all outgoing messages for a vertex in the specified graph.
Computes a vertex in the specified graph.
Creates an edge between two vertices in a graph.
Parameters
- graph_id: The ID of the graph containing the vertices
- from_vertex_id: The source vertex ID
- to_vertex_id: The destination vertex ID
- weight: The weight/cost of the edge (defaults to 1)
- properties: Additional metadata for the edge (defaults to empty map)
Examples
{:ok, edge} = PregelEx.create_edge(graph_id, "vtx.abc", "vtx.def", 2.5)
{:ok, edge} = PregelEx.create_edge(graph_id, "vtx.abc", "vtx.def", 1, %{type: "friendship"})
Creates a new graph with the given ID.
@spec create_vertex(String.t(), String.t(), (map() -> map()), keyword()) :: {:ok, String.t(), pid()} | {:error, atom()}
Creates a vertex in the specified graph.
Executes a superstep for the given graph.
Parameters
graph_id: The identifier of the graph on which to execute the superstep.
Returns
- The result of executing the superstep, as returned by
Graph.execute_superstep/1.
Gets the count of active graphs.
Gets the count of vertices in a graph.
Gets all outgoing edges for a vertex.
Gets all neighbor vertex IDs for a vertex.
Gets the state of a vertex in a graph.
Lists all edges in the graph.
Lists all active graphs.
Lists all vertices in a graph.
Removes an edge between two vertices.
Sends a message from one vertex to another in the specified graph.
Stops a graph and all its vertices.
Stops a vertex in the specified graph.