Exemplo 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;
        }
Exemplo n.º 2
0
 public Node(string id, object data, AdjacencyList neighbors)
 {
     this.Data       = data;
     this.Neighbours = neighbors;
     this.ID         = id;
 }