Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
sgraph.h
Go to the documentation of this file.
1
2/*************************************************************************
3 * Copyright (c) 2011 AT&T Intellectual Property
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors: Details at https://graphviz.org
10 *************************************************************************/
11
12#pragma once
13
14#include <ortho/structures.h>
15#include <stdbool.h>
16
17typedef struct snode snode;
18typedef struct sedge sedge;
19
26struct snode {
30 short n_adj;
32 struct cell* cells[2];
33
38 int index;
39 bool isVert; /* true if node corresponds to vertical segment */
40};
41
42struct sedge {
43 double weight; /* weight of edge */
44 int cnt; /* paths using edge */
45 /* end-points of the edge
46 * -- stored as indices of the nodes vector in the graph
47 */
48 int v1, v2;
49};
50
51typedef struct {
52 int nnodes, nedges;
53 int save_nnodes, save_nedges;
56} sgraph;
57
58extern void reset(sgraph*);
59extern void gsave(sgraph*);
60extern sgraph* createSGraph(int);
61extern void freeSGraph (sgraph*);
62extern void initSEdges (sgraph* g, int maxdeg);
63extern int shortPath (sgraph* g, snode* from, snode* to);
64extern snode* createSNode (sgraph*);
65extern sedge* createSEdge (sgraph* g, snode* v0, snode* v1, double wt);
sgraph * createSGraph(int)
Definition sgraph.c:57
snode * createSNode(sgraph *)
Definition sgraph.c:68
void initSEdges(sgraph *g, int maxdeg)
Definition sgraph.c:41
int shortPath(sgraph *g, snode *from, snode *to)
Definition sgraph.c:143
void gsave(sgraph *)
Definition sgraph.c:19
void reset(sgraph *)
Definition sgraph.c:29
void freeSGraph(sgraph *)
Definition sgraph.c:102
sedge * createSEdge(sgraph *g, snode *v0, snode *v1, double wt)
Definition sgraph.c:84
result of partitioning available space, part of maze
Definition grid.h:33
Definition sgraph.h:42
double weight
Definition sgraph.h:43
int cnt
Definition sgraph.h:44
int v2
Definition sgraph.h:48
int v1
Definition sgraph.h:48
int nedges
Definition sgraph.h:52
sedge * edges
Definition sgraph.h:55
int save_nedges
Definition sgraph.h:53
snode * nodes
Definition sgraph.h:54
a node of search graph sgraph, is created as a border segment between two adjusted cells of type cell...
Definition sgraph.h:26
short n_adj
Definition sgraph.h:30
bool isVert
Definition sgraph.h:39
int n_idx
Definition sgraph.h:27
snode * n_dad
Definition sgraph.h:28
int index
Definition sgraph.h:38
short save_n_adj
Definition sgraph.h:31
struct cell * cells[2]
[0] - left or botom, [1] - top or right adjusted cell
Definition sgraph.h:32
sedge * n_edge
Definition sgraph.h:29
int * adj_edge_list
edges incident on this node – stored as indices of the edges array in the graph
Definition sgraph.h:37
int n_val
Definition sgraph.h:27