Variable GraphMethods

GraphMethods: {
    BFSSearch: ((Graph, node) => Promise<Map<number, number>>);
    Dijkstra: ((Graph, Node) => Promise<Map<number, number>>);
    GraphDiameter: ((Graph) => Promise<{
        distance: number;
        end: number;
        start: number;
    }>);
    SelectSubgraph: ((graph, nodeList) => Promise<Graph>);
}

Type declaration

  • BFSSearch: ((Graph, node) => Promise<Map<number, number>>)
      • (Graph, node): Promise<Map<number, number>>
      • Performs a BFS search on a graph - Async because it takes a while on large graphs

        Parameters

        • Graph: Graph

          The graph which has to be searched using the BFS algorithm

        • node: number

          The node form which to start

        Returns Promise<Map<number, number>>

        • A map of which node was explored from which other node
  • Dijkstra: ((Graph, Node) => Promise<Map<number, number>>)
      • (Graph, Node): Promise<Map<number, number>>
      • Performs a dijkstra search on a graph

        Parameters

        • Graph: Graph

          The graph on which to perform the Dijkstra search

        • Node: number

          The node from which to start

        Returns Promise<Map<number, number>>

        • Map from which each one of the nodes was searched from
  • GraphDiameter: ((Graph) => Promise<{
        distance: number;
        end: number;
        start: number;
    }>)
      • (Graph): Promise<{
            distance: number;
            end: number;
            start: number;
        }>
      • Finds the diameter of the graph

        Parameters

        Returns Promise<{
            distance: number;
            end: number;
            start: number;
        }>

        returns an object with a start, end - the two points of a graph and the diameter of the graph

  • SelectSubgraph: ((graph, nodeList) => Promise<Graph>)
      • (graph, nodeList): Promise<Graph>
      • Select a subgraph

        Parameters

        • graph: Graph

          The main graph to select from

        • nodeList: number[]

          The selection of nodes that we want to select from this graph

        Returns Promise<Graph>

        A graph object that contains this subgraph

Generated using TypeDoc