Lines Matching full:graph
74 NODE *n_next; /* next node in graph */
89 static NODE *graph, **cycle_buf, **longest_cycle; variable
144 /* parse input and build the graph */ in main()
188 * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in
189 * the graph, then add them.
225 /* Find a node in the graph (insert if not found) and return a pointer to it. */
261 if ((n->n_next = graph) != NULL) in get_node()
262 graph->n_prevp = &n->n_next; in get_node()
263 n->n_prevp = &graph; in get_node()
264 graph = n; in get_node()
283 for (n = graph; n != NULL; n = n->n_next) in clear_cycle()
287 /* do topological sort on graph */
294 while (graph != NULL) { in tsort()
297 * if there are any nodes still in the graph, then there is in tsort()
301 for (cnt = 0, n = graph; n != NULL; n = next) { in tsort()
308 } while (graph != NULL && cnt); in tsort()
310 if (graph == NULL) in tsort()
319 for (cnt = 0, n = graph; n != NULL; n = n->n_next) in tsort()
326 for (n = graph; n != NULL; n = n->n_next) in tsort()
350 /* print node and remove from graph (does not actually free node) */
375 * avoid infinite loops and ignore portions of the graph known in find_cycle()