ARCcore.graph DirectedGraph Edge Methods
Login
-Home
/
-Documentation
/
-ARCcore
/
-graph
/
-DirectedGraph
/
Edge Methods
-DirectedGraph
+Algorithms
Examples
Vertex Methods
Edge Methods
Container Methods
API Objects
Serialization
DirectedGraph Edge Methods Documentation
DirectedGraph container class edge access methods.

See also: API Objects, Vertex Methods, Container Methods, Serialization

Edge methods allow you to add and remove edges from a DirectedGraph container instance, and attach, query, and remove application-specific properties from edges. Generally, edge methods accept edge read and edge write objects as input parameters. These objects are explained in the API Objects section.

DirectedGraph.addEdge

var response = digraph.addEdge({ e: { u: string, v: string }, p: data });

Request

edge write request

Response

JavaScript object with the following properties:

  • error: null or string explaining what went wrong
  • result: an edge read request object or null if error

Notes

If specified, property data should be serializable to JSON. If you need associate non-serializable data with an edge, use an external dictionary and a concatenation of the edge's u and v source and sink vertex identifiers.

If the edge already exists in the container and property data is specified, then addEdge updates the edge's property data in the container.

If the edge already exists and no property data was specified, addEdge does nothing (i.e. if there was property data assocaited with the edge it remains associated with the edge).

If your intention is to disassociate the edge from property data, call clearEdgeProperty method.

If you're calling addEdge to update property data associated with an edge (which is valid), you may wish to instead call the setEdgeProperty method instead to make your code more explicit. setEdgeProperty is just an alias for addEdge.

DirectedGraph.isEdge

var response = digraph.isEdge({ u: string, v: string });

Request

edge read request

Response

Return true if the edge is part of the graph. Otherwise, false.

Notes

isEdge will return false if you pass bad input.

DirectedGraph.removeEdge

var response = digraph.removeEdge({ u: string, v: string });

Request

edge read request

Response

JavaScript object with the following properties:

  • error: null or a string explaining what went wrong
  • result: an edge read request object or null if an error occurred

Notes

Removing an edge has no impact on the edge's vertices or on any property data associated with the vertices connected by the removed edge.

DirectedGraph.getEdgeProperty

var response = digraph.getEdgePropertyObject({ u: string, v: string });

Request edge read request

Response

Returns a reference to the property data associated with the specified edge in the graph.

If no property data is associated with the edge, the method returns undefined.

Notes

getEdgeProperty will return undefined if passed bad input, or the edge does not exist, or the edge exists but has no associated property data.

DirectedGraph.setEdgeProperty

setEdgeProperty is an alias for addEdge.

DirectedGraph.hasEdgeProperty

var response = digraph.hasEdgeProperty({ u: string, v: string });

Request

edge read request

Response

Returns true if the specified edge has associated property data. Otherwise false.

Notes

hasEdgeProperty will return false if passed input, or the edge does not exist in the graph, or if the edge exists but has no associated property data.

DirectedGraph.clearEdgeProperty

var response = digraph.clearEdgeProperty({ u: string, v: string });

Request

edge read request

Response

Returns true unless you pass bad input.

Notes

clearEdgeProperty will return false if passed bad input, or the specified edge does not exist.

Encapsule Project, Seattle WA
Copyright © 2018 Chris Russell
Sat Dec 15 2018 03:32:33 GMT-0500 (EST)

Encapsule/holism v0.0.26
Documents Under Contruction