https://github.com/sondosaabed/max-led-lighting
Find optimal number of maximum leds that can be powered using 2 dimentional dynamic programming
https://github.com/sondosaabed/max-led-lighting
dynamic-programming java javafx-application leds longest-common-subsequence
Last synced: about 1 year ago
JSON representation
Find optimal number of maximum leds that can be powered using 2 dimentional dynamic programming
- Host: GitHub
- URL: https://github.com/sondosaabed/max-led-lighting
- Owner: sondosaabed
- Created: 2022-03-03T22:03:49.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-16T21:26:20.000Z (over 3 years ago)
- Last Synced: 2025-03-29T16:34:21.328Z (over 1 year ago)
- Topics: dynamic-programming, java, javafx-application, leds, longest-common-subsequence
- Language: Java
- Homepage:
- Size: 1.06 MB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Max LED Lighting
This is a Java desktop application. Two circuit boards (S and L), where S contains n power sources, while L contains LEDs n are given. The source S sorted in ascending order <1, 2, 3, … , n>, while the LEDs on L are not <2, 9, 5, 14, 3...>. The app connects each LED in L to its pair in S (i.e., 1 with 1, 2 with 2) through unshielded wires, thus when a wire connects a LED (li) in L with its corresponding source in S (si), it may prevent other LEDs from being connected (no two wires may cross).
Example as below, if you connected l1 with s1, then 3 LEDs maximum will be lightened.

In this project I used JavaFX For User Graphical inteface. Applied Longest Common Subsequence algorithm as a dynamic solution. This project is built as an assignment for Algorithm course.
# Running the project
In order to run the project, needs the JavaFx library to be build on the projecet path.
The input of the program is:
n (number of LEDs, say 100).
A permutation of numbers (<1 to n>) :the ordering of the LEDs on the board L.
File format example
6
2 6 3 5 4 1
# Screenshots of Application
Browse for input file:

Ready to run app:

Number of LEDs:

Show board of LEDs:

Connect the LEDS based on Maximum:

Dynamic table to get the optimal solution:

Another input for 10 LEDs:

Dynamic table for 10 LEDs:
