Questions tagged [planar-graph]

In graph theory, a planar graph is a graph that can be embedded in the plane without edge crossings.

In , a planar graph is a that can be embedded in the plane, i.e., it can be drawn on the plane in such a way that its edges intersect only at their endpoints. In other words, it can be drawn in such a way that no edges cross each other.

Testing whether a graph is planar or not is called planarity testing. Kuratowski's theorem states that a graph is planar if and only if it does not contain a subgraph that is a subdivision of K5 (the complete graph on five vertices) or K3,3 (the utility graph, a complete bipartite graph on six vertices, three of which connect to each of the other three). Such a subgraph is called a Kuratowski subgraph. There are many algorithms to determine whether a certain graph is planar, one of the best known of which is the Boyer-Myrvold algorithm in O(n) (where n is the number of vertices).

Use this tag if you have questions about planarity testing implementations, libraries, or planar graph issues more generally.

70 questions
2
votes
2 answers

Planarity testing algorithm implementation

I want to write an algorithm that takes as input a graph and returns true if it is planar or false if it is not. I searched around and found tons of algorithms but no easy to understand implementations. Is there any implementation like…
thelaw
  • 570
  • 4
  • 14
2
votes
2 answers

Straight line planar embedding of a graph structure

Here is my problem: I have a graph structure (with straight line edges) which I know to be planar (i.e. there exists an embedding of the graph where no edges cross). I need an algorithm which will take my graph and produce a straight line planar…
Mustafa
  • 21
  • 1
2
votes
2 answers

Planarity Testing with exceptions for edge types

I am trying to understand if a planarity check algorithm (eg. LR Planarity, PC Tree, PQ Tree, etc...) can be enhanced such that some edges are allowed to cross depending on their type. I have a graph with edges of 3 different types: A,B,C Edges of…
Henri
  • 205
  • 1
  • 9
2
votes
1 answer

Compute dual graph from polygons

Task Compute the dual graph from a set of non-overlapping (but touching) polygons. Example Polygons A, B and C, their partially shared coordinates 1—22 (yellow) and the dual graph (blue). Data I have a set S of polygons. Every polygon Pi is…
user2033412
  • 1,950
  • 2
  • 27
  • 47
2
votes
2 answers

Correct data structure for point location algorithm

I am dealing with a programming challenge, In that I need to find the region which the given point belongs to. There is some methods here for that problem. Point Location So I decide to use slab decomposition, It is fast enough, easier to implement,…
2
votes
1 answer

Checking for outerplanarity in graph using BOOST?

I just conceptualy want to know how to check if a graph is outerplanar or not. I know you can check for planarity in graph using BOOST, how do you check for outerplanarity? hints?
LoveMeow
  • 3,858
  • 9
  • 44
  • 66
2
votes
0 answers

Creating the dual of a graph - planar face traversal - vtkBoostGraphAdapter

I'm trying to write an algorithm which creates the dual of a graph. To check whether the graph is planar or not I use the Boyer-Myrvold planarity test (Boost implementation) through the vtkBoostGraphAdapter. That works fine (only on…
2
votes
0 answers

Planar embedding for non-planar graphs in Boost Graph Library?

The boost graph library seems to have planar embedding algorithms implemented for maximally planar graphs. Does it also have anything implemented to planarize a non-planar graph? Hopefully something that minimizes crossings. I have found that the…
Alec Jacobson
  • 6,032
  • 5
  • 51
  • 88
2
votes
1 answer

Algorithm for drawing planar graph

Is there an algorithm for drawing planar graph if I have list of his faces? I know there are some complex algorithms such as path addition and vertex addition, which test planarity and produce planar embedding but it's not what I'm looking for.
user3199693
  • 128
  • 4
  • 12
2
votes
1 answer

Coloring specific type of the planar graph

I've got a specific type of the planar graph and I found it interesting to search for an algorithm which will color its vertices legally. About this type of graph, it's very easy and cool: Consider any tree T with n>2 vertices and k leaves. Let's…
xan
  • 1,053
  • 1
  • 10
  • 29
1
vote
1 answer

Java - generate class diagram by myself

I am working on a small project in Java described below: Input: List of objects for directed graph. ( Nodes with different kind of edges: inheritance, inner-class, friend classes, etc. ) Output: class diagram, as planar as possible. My problem…
Daniel
  • 11
  • 2
1
vote
0 answers

Find homography for stitching

I’m working on the following task: I have 6 fisheye cameras and would like to produce a 360 degree stitched image. After carrying out the calibration procedure with findChessboardCorners, calibrateCamera, I obtained the intrinsic and extrinsic…
1
vote
1 answer

BOOST Planar Face Traversal not visiting outer edges correctly

I want to save what are the outer nodes of my graph. For that, I have the following code (I am showing the parts I believe are relevant for the problem, I do have all the #include headers etc...): typedef adjacency_list < setS, vecS, …
ma7642
  • 139
  • 2
  • 12
1
vote
0 answers

Building faces from an incrementally constructed 2D planar graph

I'm building a video game in which a 2D planar graph is constructed edge by edge, and the faces of the graph need to be known at any given point. By "faces", I mean cycles of the graph that do not have any edges cutting through them on the 2D…
1
vote
1 answer

planar graph with fixed maximum length of edges

I want to generate random points in a 2D space, this points will be nodes of a planar graph (built using Gabriel graph algorithm or RNG ). I wrote java code to do this, but I have two hard problem to solve. 1) I need that all edges of the graph are…
tulkas85
  • 1,103
  • 1
  • 17
  • 43