-
Notifications
You must be signed in to change notification settings - Fork 1
/
Graph.h
68 lines (47 loc) · 985 Bytes
/
Graph.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* Igor Guilherme Pereira Loredo - 11275071 */
/* Natã Silva Botelho - 11275105 */
#ifndef _GRAPH_KB
#define _GRAPH_KB
//MACROS
#define ERROR -1
#define SUCCESS 1
#define ACTOR 1
#define MOVIE 2
#define BRANCO 0
#define CINZA 1
#define PRETO 2
//STRUCTS
typedef struct edge Edge;
struct edge{
int id;
Edge *next;
};
typedef struct node{
char *name;
int index;
int type;
Edge *head;
}Node;
typedef struct list{
Node **list;
int nNodes;
}List;
typedef struct graph{
List nodeList;
}Graph;
//FUNCOES
Graph *newGraph();
Edge *newEdge(int);
Node *newNode(char*, int, int);
int insertNode(Graph *, Node *);
int insertEdge(Graph *, Edge *, int);
int checkActor(Graph *, char *);
int readData(Graph *);
int getActor(Graph *, char*);
int printGraph(Graph *);
int first_adj(Graph *, int, Edge **);
int next_adj(Graph *, Edge **);
void searchActorKB(Graph *, int );
void getKBworld(Graph *, int);
void freeGraph(Graph*);
#endif