You get a bonus - 1 coin for daily activity. Now you have 1 coin

Planar Straight-Line Graph (PSLG) and RSDS

Lecture



PSLG — Planar Straight-Line Graph.

Planar Straight-Line Graph ( PSLG ) — is a term used in computational geometry for an embedding of a planar graph in the plane such that its edges become straight-line segments. Fáry's theorem (1948) states that every planar graph has an embedding of this type.

A planar graph laid out in the plane is customarily called plane. A planar embedding of a planar graph G=(V,E) — is a mapping of each vertex from V to a point in the plane, and each edge from E to a simple line connecting the pair of images of the endpoints of that edge, such that the images of the edges intersect only at their endpoints. It is well known that any planar graph can be laid out in the plane so that all edges are mapped to straight-line segments.

In computational geometry, a PSLG is often called a planar subdivision, with the assumption or assertion that the subdivision is polygonal. A maximal planar subdivision is one to which it is impossible to add a single edge joining two vertices without violating planarity.

A PSLG with no vertices of degree 1 defines a subdivision of the plane into polygonal regions, and vice versa. The absence of vertices of degree 1 simplifies the description of many algorithms, but this is not essential.

A PSLG can serve as a representation of various kinds of maps. For example, a geographic map in a geographic information system.

A special case of a PSLG is a triangulation: triangulation of a polygon, triangulation of a set of points. A point-set triangulation is a maximal PSLG in the sense that it is impossible to add straight-line edges to it while keeping the graph planar. Triangulations have numerous applications in various fields.

A PSLG can be regarded as a special kind of Euclidean graph . However, in discussions related to Euclidean graphs, the main interest lies in their metric properties, that is, the distances between vertices, whereas for a PSLG the main interest is related to topological properties. For some graphs, such as the Delaunay triangulation, both metric and topological properties are of considerable importance.

Problems in terms of a PSLG

  • Point location. For a given point, find which face of the PSLG it belongs to.
  • Map overlay. Find the overlay of two PSLGs (maps) that simultaneously subdivide the plane, forming two PS

DCEL: definition, construction of the DCEL of a set of lines

DCEL

Formal description

A doubly connected edge list is especially convenient for representing a PSLG. Let a graph G=(V,E) V={v1,v2...vn} and E={e1,e2...en} be given. The main component of the DCEL for a planar graph is the edge node. There is a one-to-one correspondence between the edges of the graph and the edge nodes of the DCEL, i.e., each edge is represented exactly once in the DCEL. The DCEL edge node corresponding to a graph edge, for example, ek={v1,v2} has 4 fields (V1,V2,F1,F2 ) and 2 pointers (P1,P2 ). The field V1 contains the start of the edge, and the field V2 contains its end (in this way, an initially undirected edge acquires a conditional orientation). The fields F1 and F2 contain the names of the faces lying to the left and to the right of the directed edge (v1,v2 ). The pointer P1 (respectively P2 ) specifies the edge node containing the first edge encountered after the edge (v1,v2 ), when turning from it counterclockwise around v1 (respectively v2 ).

Planar Straight-Line Graph (PSLG) and RSDS

Representation of a plane graph using a DCEL

Planar Straight-Line Graph (PSLG) and RSDS

A plane graph whose edges have been given an arbitrary orientation in order to represent it using a DCEL. The arrows around the vertices correspond to the pointers (P1, P2)

Planar Straight-Line Graph (PSLG) and RSDS

(a) DCEL, (b) entries by vertex head_V [1..n], and (c) entries by face head_F[1..l]

DCEL — Doubly Connected Edge List.

Planar Straight-Line Graph (PSLG) and RSDS

Towards the second description

Informal description

A DCEL consists of 3 components:

  • Vertex — is a point of articulation. It contains the coordinates of the point, as well as a pointer to an incident edge.
  • Face — contains a pointer to some edge on its boundary. For unbounded faces this is nil. It also contains a list of pointers to inner components (holes), that is, a pointer to one of the edges incident to each hole (nil, if there are no holes).
  • Half-edge — is an edge. It contains pointers to the point from which it originates (origin), a pointer to its twin edge (twin) (directed the other way), the incident face (incident_face), and pointers to the next and previous edges.
struct vertex {
    x, y;
    half_edge *rep;  /* rep->origin == this */
};
struct face {
    half_edge *out;
    list in;
};
struct half_edge {
    half_edge *prev;     /* prev->next == this */
    half_edge *next;     /* next->prev == this */
    half_edge *twin;     /* twin->twin == this */
    vertex *origin;      /* twin->next->origin == origin &&
                            prev->twin->origin == origin */
    face *incident_face; /* prev->incident_face == incident_face &&
                            next->incident_face == incident_face */
};

Construction of the DCEL of a set of lines

Planar Straight-Line Graph (PSLG) and RSDS

the corresponding chapter from de Berg needs to be rewritten here.

We have a set of lines. We want to represent this set as a DCEL.

We will add the lines one at a time. Initially we have a single face that represents the entire plane. The algorithm will be as follows:

  • Localize a random point of the line within the face
  • Find the half-edges that this line intersects (there will be no more than 2 of them, counting an intersection at a point as a single edge)
  • Split the current face into two, face1 and face2
    • If the intersection is not at a point, split the edges into two — a, b and c, d, since there are two intersections
    • Create two half-edges — the segment of the line falling within the face
    • Reassign the references of these half-edges as needed
    • Don't forget to change the incident_face field of the original face's half-edges to face1 and face2 respectively
  • We know where (into which faces — edge->twin->incident_face) our line has gone. We start from them and split them in the same way. If the intersection was at a point, we go through the faces (next_face = edge->prev->twin->incident_face) until we find the right one. If the face is infinite — we go in only one direction

Here are the references that must not be forgotten:

half_edge1->origin = A;
half_edge2->origin = B;

half_edge1->twin = half_edge2;
half_edge2->twin = half_edge1;
half_edge1->incident_face = face1;
half_edge2->incident_face = face2;

half_edge1->next = b;
b->prev = half_edge1;
half_edge1->prev = d;
d->next = half_edge1;

half_edge2->next = c;
c->prev = half_edge2;
half_edge2->prev = a;
a->next = half_edge2;

See also

  • [[b11942]]

See also

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Algorithms"

Terms: Algorithms