コード例 #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;
        }
コード例 #2
0
 public Node(string id, object data, AdjacencyList neighbors)
 {
     this.Data       = data;
     this.Neighbours = neighbors;
     this.ID         = id;
 }