Skip to content

Find optimal number of maximum leds that can be powered using 2 dimentional dynamic programming

Notifications You must be signed in to change notification settings

sondosaabed/Max-LED-Lighting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. 00

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: 1

Ready to run app: 2

Number of LEDs: 3

Show board of LEDs: 4

Connect the LEDS based on Maximum: 5

Dynamic table to get the optimal solution: 6

Another input for 10 LEDs: 7

Dynamic table for 10 LEDs: 8

About

Find optimal number of maximum leds that can be powered using 2 dimentional dynamic programming

Topics

Resources

Stars

Watchers

Forks

Languages