Lines Matching defs:graph
144 NODE *n_next; /* next node in graph */
153 static NODE *graph = NULL, **cycle_buf = NULL, **longest_cycle = NULL;
157 /* Find a node in the graph (insert if not found) and return a pointer to it. */
163 for (n = graph; n && n->n_name && strcmp(n->n_name, name);
178 if ((n->n_next = graph) != NULL)
179 graph->n_prevp = &n->n_next;
180 n->n_prevp = &graph;
181 graph = n;
187 * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in
188 * the graph, then add them.
232 for (n = graph; n != NULL; n = n->n_next)
236 /* print node and remove from graph (does not actually free node) */
284 * avoid infinite loops and ignore portions of the graph known
323 /* do topological sort on graph */
330 while (graph != NULL) {
333 * if there are any nodes still in the graph, then there is
337 for (cnt = 0, n = graph; n != NULL; n = next) {
344 } while (graph != NULL && cnt);
346 if (graph == NULL)
355 for (cnt = 0, n = graph; n != NULL; n = n->n_next)
362 for (n = graph; n != NULL; n = n->n_next)
383 if (graph)
384 free_nodes(graph);
394 graph = NULL;
402 * Parse list and build the graph. Enter them in reverse order
431 if (graph)
432 free_nodes(graph);