PregelEx.Edge (PregelEx v0.1.3)

View Source

Represents an edge in the graph connecting two vertices.

An edge contains:

  • from_vertex_id: The source vertex ID
  • to_vertex_id: The destination vertex ID
  • weight: Optional weight/value associated with the edge (defaults to 1)
  • properties: Additional metadata for the edge

Summary

Functions

Creates a new edge with the given parameters.

Types

t()

@type t() :: %PregelEx.Edge{
  condition: term(),
  from_vertex_id: String.t(),
  properties: map(),
  to_vertex_id: String.t(),
  weight: number()
}

Functions

new(from_vertex_id, to_vertex_id, opts \\ [])

Creates a new edge with the given parameters.

Examples

iex> PregelEx.Edge.new("vtx.abc123", "vtx.def456", 2.5)
%PregelEx.Edge{
  from_vertex_id: "vtx.abc123",
  to_vertex_id: "vtx.def456",
  weight: 2.5,
  properties: %{}
}