Go to the source code of this file.
Data Structures | |
struct | graph |
The type of the graph. More... | |
struct | node |
The type of a graph node. More... | |
Typedefs | |
typedef node | Node |
The type of a graph node. More... | |
typedef graph | Graph |
The type of the graph. More... | |
Functions | |
int | graph_init (Graph *graph, const char *file_name) |
Initializes a graph. More... | |
void | graph_clear (Graph *graph) |
Clears a graph. More... | |
void | BFS (Node *root) |
Implements the Breath-First-Search algorithm. More... | |
Node * | get_node_by_id (Graph *graph, unsigned int id) |
Obtains a graph node by its id. More... | |
void | tree_print (Node *root) |
Prints a tree from root. More... | |
void | exit_error (char *err_msg) |
Clears the resources and exists with an error code. More... | |
void | print_help (char *prog_name) |
Prints a concise message describing the command line. More... | |
int | get_line (FILE *stream, char *line, int size) |
Reads a line from the input stream. More... |
|
The type of the graph.
|
|
|
|
Implements the Breath-First-Search algorithm.
|
|
Clears the resources and exists with an error code.
|
|
Reads a line from the input stream.
|
|
Obtains a graph node by its id. Obtains a graph node by its id. If the id is invalid, generates an error |
|
Clears a graph. Clears a graph Deallocates all data structures used by a graph |
|
Initializes a graph. Reads a description of a graph from an input file and creates it. Allocates an array if nodes, and adds arcs as necessary.
|
|
Prints a concise message describing the command line.
|
|
Prints a tree from root.
|