随笔分类 -  拓扑排序

摘要:拓扑排序一.概念 由某个集合上的一个偏序得到该集合上的一个全序,这个操作称之为拓扑排序。二.拓扑排序方法如下: (1)从有向图中选择一个没有前驱(即入度为0)的顶点并且输出它. (2)从网中删去该顶点,并且删去从该顶点发出的全部有向边. (3)重复上述两步,直到剩余的网中不再存在没有前趋的顶点为止.三.算法实现 1.普通实现 1 #include<iostream> 2 #include<stdlib.h> 3 #include<stdio.h> 4 #define MAX 100 5 using namespace std; 6 7 void toposo 阅读全文
posted @ 2013-04-23 20:54 萧凡客 阅读(149) 评论(0) 推荐(0) 编辑
摘要:DescriptionOrder is an important concept in mathematics and in computer science. For example, Zorn's Lemma states: ``a partially ordered set in which every chain has an upper bound contains a maximal element.'' Order is also important in reasoning about the fix-point semantics of program 阅读全文
posted @ 2012-10-28 10:16 萧凡客 阅读(260) 评论(0) 推荐(0) 编辑