ARCcore.graph DirectedGraph API Parameter Objects
Login
-Home
/
-Documentation
/
-ARCcore
/
-graph
/
-DirectedGraph
/
API Objects
-DirectedGraph
+Algorithms
Examples
Vertex Methods
Edge Methods
Container Methods
API Objects
Serialization
DirectedGraph API Parameter Objects
DirectedGraph container conventions, vertex and edge input parameter object types.

Method notation

For convenience we abbreviate functions defined on the DirectedGraph prototype object, e.g. isVertex, using the notation DirectedGraph.isVertex.

But, you can't actually call DirectedGraph.isVertex using this syntax: DirectedGraph is the private constructor function and it's not exported. To construct a DirectedGraph instance call the software factory method arccore.graph.directed.create.

const graph = require('arccore').graph;
var digraph = graph.directed.create().result;
var foundStartVertex = digraph.isVertex("startVertex"); // e.g.

Vertex & Edge Method Input Parameters

See also: Vertex Methods, EdgeMethods, Serialization

Methods of the DirectedGraph class that operate on vertices and edges in the container (there are many) accept as input one of four standardized in-parameter types based on two dimenions: target entity (vertex vs. edge), and operation (read vs. write). Read operations query the state of the container but do not mutate it. Write operations mutate the state of the container.

Vertex Read Request

A vertex read request is a string that is interpreted as the unique ID of a vertex in a container.

var vertexReadRequest = "vertexID";
var bool foundIt = digraph.isVertex(vertexReadRequest);

Vertex Write Request

A vertex write request is an object with required string property u and optional data property p.

var vertexWriteRequest = {
    u: "vertexID",
    p: { notes: "data to associate with the 'vertexID' vertex in the container" }
};
digraph.addVertex(vertexWriteRequest);

Edge Read Request

An edge read request is an object with required string properties u and v.

var edgeReadRequest = { u: "Hello", v: "World" };
var boolFountIt = digraph.isEdge(edgeReadRequest);

Edge Write Request

An edge write request is an object with required sub-object e and optional data property p.

var edgeWriteRequest = {
    e: { u: "Hello", v: "World" },
    p: { notes: "Some data to associate with the edge from 'Hello' to 'World'" }
};
digraph.addEdge(edgeWriteRequest);
Encapsule Project, Seattle WA
Copyright © 2018 Chris Russell
Sat Dec 15 2018 04:02:09 GMT-0500 (EST)

Encapsule/holism v0.0.26
Documents Under Contruction