Esempio n. 1
0
        public void SortGraphbyDegree()
        {
            AdjacencyList newList = new AdjacencyList();

            var sorted = from n in Nodes
                         orderby n.Neighbors.Count descending
                         select n;

            Nodes = (AdjacencyList)sorted;
        }
Esempio n. 2
0
 public Node(string id, object data, AdjacencyList neighbors)
 {
     this.Data       = data;
     this.Neighbours = neighbors;
     this.ID         = id;
 }