-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.h
More file actions
33 lines (31 loc) · 823 Bytes
/
Graph.h
File metadata and controls
33 lines (31 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include "MathLibrary.h"
#include "LinearLinkedListNode.h"
#ifndef __Vertic
#define __Vertic
typedef struct {
int offsetInArr;
void* value;
}Vertic;
#endif // !__Vertic
#ifndef __GRAPH
#define __GRAPH
typedef struct
{
int V;
int** ArcMat;
Vertic** Vertices;
} Graph;
#endif // !__GRAPH
//Init graph
void InitGraph(Graph**,void**, int);
//join arc between two vertices
void JoinArc(Graph* , Vertic* , Vertic* );
//join arc with weight between two vertices
void JoinWeightArc(Graph* , Vertic* , Vertic* , int );
//remove arc between two vertices
void RemoveArc(Graph* , Vertic*, Vertic*);
// retrun true if A as an arc for B
BOOL IsAdjacent(Graph*, Vertic*, Vertic*);
//retrun all the adjacent of a certin vertic
LinearLinkedListNode* GetAllAdjacent(Graph* g, Vertic* a);