StarGraph

public enum StarGraph<V> where V : Decodable, V : Encodable, V : Equatable

A type used to construct an UnweightedGraph with vertices of type V that is isomorphic to a star graph. https://en.wikipedia.org/wiki/Star_(graph_theory)

  • Constructs an undirected UnweightedGraph isomorphic to a star graph.

    Declaration

    Swift

    public static func build(withCenter center: V, andLeafs leafs: [V]) -> UnweightedGraph<V>

    Parameters

    center

    The vertex that is connected to all vertices except itself.

    leafs

    The set of vertices that are connected only to the center vertex.

    Return Value

    An UnweightedGraph star graph with the center vertex connected to all the leafs. The leafs are only connected to the center