Class: Vertex

Vertex(v)

new Vertex(v)

Create a graph vertex using a special input object, also called a configuration object since it is used to configure the user properties of the vert.
Parameters:
Name Type Description
v object Input (configuration) object containing info used to initialize the vertex (such as a label)
Properties
Name Type Description
label string Required property (note how fields of input object are documented)
Author:
  • Muhammad Al-Hashimi
Source:
See:
  • better_input for details of config objects of the default internal input format.

Members

(private) adjacent

Head pointer of a vertex adjacency list.
Source:

label

A text string to label a vertex, passed as arg to vertex constructor.
Source:

visit :boolean

Mark vertex visited or "seen" (useful for traversals and such).
Typeboolean
Default Value:
  • false
Source:

Methods

adjacentByID()

Get id of adjacent vertices in an array.
Source:

incidentEdges()

Get information of incident edges in an array of custom objects (details depend on implementation).
Source:
See:

insertAdjacent()

Insert an edge target vertex in adjacency list. An optional edge weight may also be specified. This method hides adjacency implementation details (it does the actual work on behalf of graph methods).
Source:
See:
To Do:
  • Left for students as exercise.

vertexInfo()

Get printable vertex info strings, details depend on implementation.
Source: