splash
This commit is contained in:
22
structs.h
22
structs.h
@@ -6,16 +6,26 @@
|
||||
#define GRAPHE_STRUCTS_H
|
||||
|
||||
struct node_t {
|
||||
int id; // node id
|
||||
struct node_t **neighbours; // node neighbours
|
||||
int id; // node id
|
||||
struct node_t *next; // next node
|
||||
};
|
||||
typedef struct node_t node_t;
|
||||
|
||||
struct graph_t {
|
||||
int n; // number of nodes
|
||||
int p; // probability that two nodes from the same group are linked
|
||||
int q; // probability that two nodes from different groups are linked
|
||||
int n; // number of vertices
|
||||
double p; // probability that two nodes from the same group are linked
|
||||
double q; // probability that two nodes from different groups are linked
|
||||
node_t **adj_lists; // adjacent list
|
||||
};
|
||||
typedef struct graph_t graph_t;
|
||||
|
||||
#endif //GRAPHE_STRUCTS_H
|
||||
// structure-related functions
|
||||
node_t *create_node(int id);
|
||||
graph_t *create_graph(int n, double p, double q);
|
||||
void add_edge(graph_t *graph, int src, int dest);
|
||||
graph_t *basic_graph();
|
||||
graph_t *generate_graph(int n, double p, double q);
|
||||
void displayGraph(graph_t *graph);
|
||||
void free_graph(graph_t *graph);
|
||||
|
||||
#endif // GRAPHE_STRUCTS_H
|
||||
|
||||
Reference in New Issue
Block a user