Ejemplo n.º 1
0
 void main()
 {
   ALGraph h;
   printf("请选择有向网\n");
   CreateGraph(h); // 构造有向网h,在bo7-2.cpp中
   Display(h); // 输出有向网h,在bo7-2.cpp中
   CriticalPath(h); // 求h的关键路径
 }
int main(void)
{    
	MGraph G;    
	GraphAdjList GL;    
	CreateMGraph(&G);
	CreateALGraph(G,&GL);
	CriticalPath(GL);
	return 0;
}
Ejemplo n.º 3
0
Archivo: Topo.c Proyecto: GaobinWang/C
int main(int argc, const char *argv[])
{
  GraphAdjList GL = (GraphAdjList )malloc(sizeof (graphAdjList));
  CreateTopo(GL);
  //int status = TopologicalSort(GL);
  //printf("\n%d\n", status);
  CriticalPath(GL);
  puts("");  
}
Ejemplo n.º 4
0
int main(int argc, const char *argv[])
{
    int i, n, edge, k, vertex, duration;
    scanf("%d %d", &n, &edge);
    for (i = 0; i < edge && scanf("%d %d %d", &k, &vertex, &duration); ++i)
        insertNode(k, vertex, duration);
    topSort(n);
    printf("Critical Length: %d\n", CriticalPath(n));
    return 0;
}