Finalists solution to BWINF 37 Round 2 - Only procedural pathfinding with collision detection along with clever weights for time adjustment will guide Lisa to her goal to getting up as late as possible.
Find a file
2026-06-11 17:37:15 +02:00
.assets add readme 2026-06-11 17:37:15 +02:00
examples initial commit 2019-10-28 14:03:15 +01:00
Properties initial commit 2019-10-28 14:03:15 +01:00
.gitattributes initial commit 2019-10-28 14:03:15 +01:00
.gitignore initial commit 2019-10-28 14:03:15 +01:00
App.config initial commit 2019-10-28 14:03:15 +01:00
App.xaml initial commit 2019-10-28 14:03:15 +01:00
App.xaml.cs initial commit 2019-10-28 14:03:15 +01:00
Aufgabe1.csproj initial commit 2019-10-28 14:03:15 +01:00
Aufgabe1.pdf add docs 2023-08-05 04:51:55 +02:00
Aufgabe1.sln initial commit 2019-10-28 14:03:15 +01:00
Dijkstra.cs initial commit 2019-10-28 14:03:15 +01:00
KollisionDemo.xaml initial commit 2019-10-28 14:03:15 +01:00
KollisionDemo.xaml.cs initial commit 2019-10-28 14:03:15 +01:00
MainWindow.xaml initial commit 2019-10-28 14:03:15 +01:00
MainWindow.xaml.cs initial commit 2019-10-28 14:03:15 +01:00
Pfadberechnung.cs initial commit 2019-10-28 14:03:15 +01:00
PIPDemo.xaml initial commit 2019-10-28 14:03:15 +01:00
PIPDemo.xaml.cs initial commit 2019-10-28 14:03:15 +01:00
README.md add readme 2026-06-11 17:37:15 +02:00

BWINF 37.2 - Lisa rennt

C#/WPF tool for task 1 of the 37th German federal CS competition, round 2.

Lisa runs 15 km/h, bus drives 30 km/h up the y-axis, leaves (0,0) at 7:30. Polygonal obstacles block the way. Find when she must leave home and which path to take.

Shortest path = straight segments between obstacle vertices (visibility graph). Last segment hits the street at 30°.

How it works

Visibility graph (naive, O(n³)). Generate all candidate edges: chords inside each obstacle (SetzeInnenstrecken), edges between different obstacles and from the start point (SetzeAussenstrecken). Discard any that intersect an obstacle edge (Kollision, 2×2 matrix intersection). Remove chords that fall outside their polygon (PunktInPolygon, ray casting).

Street edges. Each vertex gets a street intercept point at the optimal angle. Edge weight = Lisa's run time minus bus travel time to that point. A sink vertex collects these edges with the remaining bus time baked in as fake distance.

Shortest path. Standard Dijkstra on the visibility graph from start to sink. Lisa's running distance = distance of the second-to-last vertex. Departure time follows from that.

UI. Loads example files, draws obstacles, visibility graph, and the computed path. Two small demos (collision, point-in-polygon) are included.

Usage

Open a file from the menu (examples/lisarennt1.txt .. lisarennt5.txt). The computed route and departure time are shown.

Visibility graph and shortest path