Core 1.0
|
A simple geometric graph. More...
#include <geometricgraph.h>
Public Member Functions | |
GeometricGraph2 () | |
Create an empty geometric graph. | |
GeometricGraph2 (const QVector< Vector2 > &, bool=false) | |
Create an empty geometric graph. More... | |
GeometricGraph2 (const Mesh2 &) | |
Create a geometric graph from a mesh. More... | |
void | AddEdge (int, int, double) |
Add an edge to the graph. More... | |
void | AddEdge (int, int) |
Add an edge to the graph. More... | |
int | Edges () const |
Return the number of edges. | |
QPoint | Edge (int) const |
Return the i-th edge as a pair or integers. | |
GeometricGraph2 | Kruskal () const |
Compute the minimum spanning tree using Kruskal's algorithm. | |
GeometricGraph2 | Nearest () const |
Compute the nearest geometric graph. | |
GeometricGraph2 | Urquhart () const |
Generate the Urquhart graph. More... | |
GeometricGraph2 | Relative () const |
Compute the relative neighbor graph. More... | |
GeometricGraph2 | Gabriel () const |
Compute the Gabriel graph. | |
GeometricGraph2 | Gamma (double) const |
Compute the gamma-skeleton graph. More... | |
GeometricGraph2 | Beta (double, bool=false) const |
Compute the beta-skeleton graph, either using a circle or lens based definition. More... | |
GeometricGraph2 | SubNearest (const Vector2 &, int) const |
Compute the minimum spanning tree using Kruskal's algorithm. | |
double | Weight () const |
Compute the global weight of the geometric graph. More... | |
bool | Exists (int, int) const |
Tests if an edge exists in the graph. More... | |
GeometricGraph2 | Reverse () const |
Return the reversed geometric graph. More... | |
void | Draw (QGraphicsScene &) const |
Draw the cluster. More... | |
Protected Attributes | |
std::vector< WeightEdge > | edges |
Set of edges. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const GeometricGraph2 &) |
Overloaded output-stream operator. More... | |
A simple geometric graph.
Geometric graphs.
|
explicit |
Create an empty geometric graph.
v | Vector set. |
complete | Boolean to check if complete graph should be computed. |
|
explicit |
Create a geometric graph from a mesh.
mesh | The mesh. |
void GeometricGraph2::AddEdge | ( | int | a, |
int | b | ||
) |
Add an edge to the graph.
Weight is computed from the points as the Euclidean distance
a,b | Indexes. |
void GeometricGraph2::AddEdge | ( | int | a, |
int | b, | ||
double | w | ||
) |
Add an edge to the graph.
a,b | Indexes. |
w | Weight. |
GeometricGraph2 GeometricGraph2::Beta | ( | double | beta, |
bool | circle = false |
||
) | const |
Compute the beta-skeleton graph, either using a circle or lens based definition.
The Gabriel graph is the closed 1-skeleton and the relative neighborhood graph is the open 2-skeleton.
beta | Beta parameter, should be >1. |
circle | Set to true to use the circle-based definiton, lens-based otherwise. |
void GeometricGraph2::Draw | ( | QGraphicsScene & | scene | ) | const |
Draw the cluster.
scene | Graphics scene. |
bool GeometricGraph2::Exists | ( | int | a, |
int | b | ||
) | const |
Tests if an edge exists in the graph.
a,b | Vertex indexes. |
GeometricGraph2 GeometricGraph2::Gamma | ( | double | gamma | ) | const |
Compute the gamma-skeleton graph.
gamma | Gamma parameter, should be >1. |
GeometricGraph2 GeometricGraph2::Relative | ( | ) | const |
Compute the relative neighbor graph.
An undirected graph defined on a set of points in the Euclidean plane by connecting two points if there does not exist a third point that is closer to both those than they are to each other.
Toussaint, G. T. The relative neighborhood graph of a finite planar set. Pattern Recognition, 12 (4): 261–268, 1980.
Jaromczyk, J.W.; Toussaint, G.T. Relative neighborhood graphs and their relatives. Proceedings of IEEE, 80 (9): 1502-1517, 1992.
GeometricGraph2 GeometricGraph2::Reverse | ( | ) | const |
Return the reversed geometric graph.
The graph has the same number of edges but with opposite directions, and preserves weigth.
GeometricGraph2 GeometricGraph2::Urquhart | ( | ) | const |
Generate the Urquhart graph.
Formed by removing the longest edge from every triangle in the Delaunay triangulation, it was originally proposed as a fast method to compute the relative neighborhood graph.
double GeometricGraph2::Weight | ( | ) | const |
Compute the global weight of the geometric graph.
Weight is defined as the sum of the weights of the edges.
|
friend |
Overloaded output-stream operator.
g | Geometric graph. |
s | Stream. |