Hierarchy

  • Kruskal

Constructors

Methods

Constructors

Methods

  • Finds the Minimum Spanning Tree using Kruskal's algorithm

    Parameters

    • vertices: string[]

      array of vertex names

    • edges: Edge[]

      array of edges with weights

    Returns MSTResult

    object containing MST edges and total weight

  • Checks if a graph is connected (prerequisite for MST)

    Parameters

    • vertices: string[]

      array of vertex names

    • edges: Edge[]

      array of edges

    Returns boolean

    true if graph is connected, false otherwise

Generated using TypeDoc