/Polygonal-Puzzle

A geometric algorithm that finds the maximum possible length of the common boundary of two polygons when they are optimally placed.

Primary LanguageRust

Polygonal Puzzle

A geometric algorithm that finds the maximum possible length of the common boundary of two polygons when they are optimally placed.

Problem Source: ACM-ICPC World Finals 2016

Overview

A Rust solution for the Polygonal Puzzle problem.

Results are converted into SVG. Example:

Run

Run all tests manually (it uses the official test data):

cargo run --release < tests/data/input

Or compare output using cpdiff:

cargo run --release < tests/data/input | cpdiff tests/data/output

Format & Lint

cargo fmt
touch src/main.rs && touch src/lib.rs && cargo clippy

Testing

cargo test

Alternative Solution (C++)

Another solution in C++ is here.