File

src/graph/vertex.ts

Index

Properties

Constructor

constructor(value: T)
Parameters :
Name Type Optional
value T No

Properties

Optional edges
Type : Map<number | Vertex<T>>
Default value : new Map()
id
Type : number
Private types
Type : VertexType[]
value
Type : T
import { VertexType } from './vertex-type.enum';
import { v4 as uuidv4 } from 'uuid';

export default class Vertex<T> {
  private types: VertexType[];
  id: number;
  value: T;
  edges?: Map<number, Vertex<T>> = new Map();

  constructor(value: T) {
    this.id = uuidv4();
    this.value = value;
    this.types = [VertexType.LABELED];
  }
}

results matching ""

    No results matching ""