Graph Theory Brock University图论布鲁克大学.pptVIP

  • 8
  • 0
  • 约5.8千字
  • 约 20页
  • 2017-03-07 发布于上海
  • 举报

Graph Theory Brock University图论布鲁克大学.ppt

Graph Theory Brock University图论布鲁克大学

Graph Theory ? Dave Bockus Adjacency Matrix Adjacency List Example DAG TopSort void topsort( ) throws CycleFound { Queue q; int counter = 0; Vertex v,w; q = new Queue(); for each vertex v if (indegree == 0) q.enqueue(v); while (!q.empty()) { v = q.dequeue(); v.topNum = ++counter; for each w adjacent to v if (--w.indegree==0) q.enqueue(w); } if (counter != NUM_VERTICES) throw new CycleFound(); } TopSort Example Shortest Path Unweighted edges Q.Enqueue(v0); while (!Q.IsEmpty) { V = Q.Dequeue(); for (Each W adjacent to V) if(T[W].Dist == Maxin

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档