综述
一共四步
1、根据拓扑排序求ve
2、根据逆拓扑排序求vl
3、由ve求e,由vl求l
4、输出关键活动、权值
***************************************************************************************************************************
其中:
顶点对应事件发生,最早ve,最晚用vl
边对应活动开始,最早用e,最晚用l
求法
1、ve:ve[i] = max{ve[前]+边权}
ve[0]=0
2、vl:vl[i] = min{vl[后]-边权}
vl[最后]=ve[最后]
3、e:ve[前]
4、l:vl[后]-边权
***************************************************************************************************************************
关键路径
若额e[i] == l[i],则为关键活动
数据结构
//增加id用于标识边,与e和l数组下标对应
//增加data记录边权值
typedef struct Side//边
{
int toVertex;//边指向的点
int data;
int id;
struct side *next;
}