2020
Himanshu Raj
pgRouting Boyer Myrvold Planarity Testing
What are planar Graphs:-
pgRouting Boyer Myrvold Planarity Testing
Some Non-Planar Graphs :-
K5
K3,3
pgRouting Boyer Myrvold Planarity Testing
pgRouting Boyer Myrvold Planarity Testing
CREATE TABLE edge_table (
id BIGSERIAL,
source BIGINT,
target BIGINT,
cost FLOAT,
reverse_cost FLOAT);
INSERT INTO edge_table
(source, target, cost, reverse_cost) VALUES
(1, 2, 1, 1), (2, 3, 1, 1),
(3, 4, 1, 1), (4, 5, 1, 1),
(5, 1, 1, 1);
3
1
5
4
2
pgRouting Boyer Myrvold Planarity Testing
SELECT * FROM pgr_isPlanar(
'SELECT id, source, target, cost, reverse_cost
FROM edge_table'
);
pgr_isplanar
--------------
t
(1 row)
3
1
5
4
2
pgRouting Boyer Myrvold Planarity Testing
INSERT INTO edge_table
(source, target, cost, reverse_cost) VALUES
(3, 1, 1, 1), (3, 5, 1, 1),
(4, 1, 1, 1), (4, 2, 1, 1),
(5, 2, 1, 1);
SELECT * FROM pgr_isPlanar(
'SELECT id, source, target, cost, reverse_cost
FROM edge_table'
);
pgr_isplanar
--------------
f
(1 row)
3
1
5
4
2
pgRouting Make Connected
pgRouting Make Connected
CREATE TABLE edge_table (
id BIGSERIAL,
source BIGINT,
target BIGINT,
cost FLOAT,
reverse_cost FLOAT);
INSERT INTO edge_table
(source, target, cost, reverse_cost) VALUES
(1, 2, 1, 1),(3, 4, 1, 1), (5, 6, 1, 1);
4
2
6
1
5
3
pgRouting Make Connected
SELECT * FROM pgr_makeConnected(
'SELECT id, source, target, cost, reverse_cost
FROM edge_table'
);
seq | start_vid | end_vid
-----+-----------+---------
1 | 2 | 3
2 | 4 | 5
(2 rows)
4
2
6
1
5
3
See Himanshu’s work
The future ....
https://github.com/pgRouting
Thanks!
Presentation under Creative Commons Licence.
Web: pgrouting.org
Documentation: docs.pgrouting.org
workshop: workshop.pgrouting.org
Support: pgrouting.org/support.html
More Information
… or talk to me at