// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // Build a Directed Graph with 100 nodes // Test KeepAlive for huge directed graphs namespace Default { using System; public class Graph { private Vertex Vfirst = null; private Vertex Vlast = null; private Edge Efirst = null; private Edge Elast = null; private int WeightSum = 0; public static int Nodes; public static bool flag; public Graph(int n) { Nodes = n;} public void SetWeightSum() { Edge temp = Efirst; WeightSum = 0; while(temp != null) { WeightSum += temp.Weight; temp = temp.Next; } } public int GetWeightSum() { return WeightSum; } public void BuildEdge(int v1,int v2) { Vertex n1 = null,n2 = null; Vertex temp = Vfirst; while(temp != null) { if (v1 == temp.Name) { //found 1st node.. n1 = temp; break; } else temp = temp.Next; } //check if edge already exists for(int i=0;i