public AdjancenceArray(AdjancenceVector <T> adjancenceVector) { Random rand = new Random(); int nodes = adjancenceVector.NodesCount; data = new T?[nodes, nodes]; for (int node = 0; node < nodes; ++node) { (int, T)[] adjancentNodes = adjancenceVector.Data[node];
public ArticulationNodes(AdjancenceVector <T> graph) { this.graph = graph; order = 0; pre = new int[graph.NodesCount]; low = new int[graph.NodesCount]; Array.Fill(pre, -1); stack = new NodeStack <int>(); data = null; }
public TarjanStrongConnected(AdjancenceVector <T> graph) { this.graph = graph; order = 0; pre = new int[graph.NodesCount]; low = new int[graph.NodesCount]; stack = new NodeStack <int>(); Array.Fill(pre, -1); skewStackQueue = new NodeStack <NodeQueue <int> >(); data = null; }
static public void Print(AdjancenceVector <double> graph) { if (graph.NodesCount == 0) { Console.WriteLine("No nodes\n"); return; } (ConsoleColor foregroundColor, ConsoleColor backgroundColor) = (Console.ForegroundColor, Console.BackgroundColor); for (int node = 0; node < graph.NodesCount; ++node) { Console.ForegroundColor = ConsoleColor.Gray; Console.Write($" {node,2}:"); Console.ForegroundColor = ConsoleColor.White; (int, double)[] adjancentNodes = graph.Data[node];
public Graph(AdjancenceVector <T> adjancenceVector) { Data = adjancenceVector; }
public DemucronLevels(AdjancenceVector <T> graph) { this.graph = graph; data = null; }
public BoruvkaSpanningTree(AdjancenceVector <T> graph) { this.graph = graph; data = null; }
public KruskalSpanningTree(AdjancenceVector <T> graph) { this.graph = graph; data = null; }