22 G->save_nnodes =
G->nnodes;
23 G->save_nedges =
G->nedges;
24 for (i = 0; i <
G->nnodes; i++)
25 G->nodes[i].save_n_adj =
G->nodes[i].n_adj;
32 G->nnodes =
G->save_nnodes;
33 G->nedges =
G->save_nedges;
34 for (i = 0; i <
G->nnodes; i++)
35 G->nodes[i].n_adj =
G->nodes[i].save_n_adj;
36 for (; i <
G->nnodes+2; i++)
37 G->nodes[i].n_adj = 0;
46 for (i = 0; i < g->
nnodes; i++) {
50 for (; i < g->
nnodes+2; i++) {
131#define UNSEEN INT_MIN
151 for (x = 0; x<g->
nnodes; x++) {
163 fprintf (stderr,
"process %d\n", n->
index);
167 for (y=0; y<n->
n_adj; y++) {
170 if (
N_VAL(adjn) < 0) {
174 fprintf (stderr,
"new %d (%d)\n", adjn->
index, -d);
182 if (
N_VAL(adjn) < d) {
184 fprintf (stderr,
"adjust %d (%d)\n", adjn->
index, -d);
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
void PQupdate(snode *n, int d)
snode priority queue for shortPath in sgraph
void freeSGraph(sgraph *g)
static void addEdgeToNode(snode *np, int idx)
void initSEdges(sgraph *g, int maxdeg)
sedge * createSEdge(sgraph *g, snode *v1, snode *v2, double wt)
int shortPath(sgraph *g, snode *from, snode *to)
snode * createSNode(sgraph *g)
static snode * adjacentNode(sgraph *g, sedge *e, snode *n)
sgraph * createSGraph(int nnodes)
a node of search graph sgraph, is created as a border segment between two adjusted cells of type cell...
int * adj_edge_list
edges incident on this node – stored as indices of the edges array in the graph