Created
July 22, 2014 08:08
-
-
Save manku-timma/4c5560756aae379289b3 to your computer and use it in GitHub Desktop.
Graph api file - Toy programs for implementing graph algorithms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __GRAPH_H_INCLUDED__ | |
#define __GRAPH_H_INCLUDED__ | |
#define MAX_VERTICES 10 | |
struct graph { | |
int vertices[MAX_VERTICES]; | |
int edges[MAX_VERTICES][MAX_VERTICES]; | |
int visited[MAX_VERTICES]; | |
}; | |
void graph_init(struct graph* g); | |
void graph_print(struct graph* g); | |
void graph_print_bidi_dot(struct graph* g); | |
void graph_print_dot(struct graph* g); | |
void graph_add_edge(struct graph* g, int src, int dest, int weight); | |
void graph_add_bidi_edge(struct graph* g, int src, int dest, int weight); | |
void graph_dfs_recursive(struct graph* g, int start); | |
void graph_bfs(struct graph* g, int start); | |
void graph_bfs_print_path(int start, int end); | |
#endif // __GRAPH_H_INCLUDED__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment