-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
69 lines (54 loc) · 1.38 KB
/
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
69
/******************************************************************************
* File Name: graph.h
* Author: João Rodrigues, Sara Vieira
* Revision: v1.0
* NAME
* Projeto-Gestor de Parque
* SYNOPSIS
* #include <stdlib.h>
* #include <stdio.h>
*****************************************************************************/
#ifndef GraphHeader
#define GraphHeader
#define VIA 0
#define ENTRADA 1
#define ACESSO 2
#define RAMPA 3
#define LUGAR 4
#define LIVRE 0
#define OCUPADO 1
/*
* Data type: vertice
*
* Description: description of any kind of crossroad, entries, exits or ramp
*/
typedef struct edge
{
int w;
int dist;
struct edge *next;
} Edge;
typedef struct{
int tipo;
int x;
int y;
int z;
int estado; /*ocupaçao de lugar ou via*/
int rest;
char ar_type; /*tipo de acesso ou direçao da rampa - u or d*/
Edge *list_adj;
}vertice;
typedef struct graph
{
int V;
int E;
vertice *v_vert;
} Graph;
Graph *GRAPHinit(int); /*Cria grafico com o numero final de vertices, sem arestas*/
void GRAPHpfs(Graph *G, int s, int *st, int *wt); /*calcula a arvore de caminhos mais curtos para um dado vertice*/
Edge* GRAPHinsertE(Graph *G, int v, int w, int dist); /*insere uma aresta no grafo*/
void GRAPHdestroy(Graph *G);
int GRAPHfindV(Graph *G, int x, int y, int z);
void GRAPHfindC(Graph *G, int v, int *x, int *y, int *z);
int compara_heap(int a, int b);
#endif