-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Left-Right Planarity test. (#475)
* Add Left-Right Planarity test. This commit implements a new function `is_planar` that checks if an undirected graph can be drawn in a plane without any edge intersections. The planarity check algorithm is based on the Left-Right Planarity Test. Reference: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.217.9208 * fix clippy * fix compiler error * add generalized Petersen graph as test cases * remove old release note * Update release note import * fix release note * `or_insert` can be omitted. * cargo fmt Co-authored-by: Matthew Treinish <mtreinish@kortar.org> Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
- Loading branch information
1 parent
ced0310
commit 5b50f3f
Showing
9 changed files
with
1,319 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
features: | ||
- | | ||
Implements a new function :func:`~rustworkx.is_planar` that | ||
checks whether an undirected :class:`~rustworkx.PyGraph` is planar. | ||
.. jupyter-execute:: | ||
import rustworkx as rx | ||
graph = rx.generators.mesh_graph(5) | ||
print('Is K_5 graph planar?', rx.is_planar(graph)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.