Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.52 KB

README.MD

File metadata and controls

34 lines (22 loc) · 1.52 KB

Floppy Disk Packing

An implementation of the Bin Packing (Offline) Algorithm as applied to optimizing Floppy Disk memory distribution.

Problem Statement

You have an arbitrary number of files, each less than 1.44MB. The files total 128MB and you have 120 floppy disks available. Each floppy disk has a capacity of 1.44MB. Find the optimal distribution of files to floppy disks.

Methodology

A First Fit Decreasing Algorithm was implemented to solve this problem. It runs in O(n2) time. Given the small data set, this is sufficient. A more complex way of implementing the First Fit Decreasing Algorithm can be done using self balancing trees with a runtime of O(n log n).

Data

Data is self-generated via the FloppyData.py file.

How to run

Requires no third party libraries. Simply clone this repo, shell into the folder, and run Main.py.

$ python Main.py

Commentary

Further optimizations may include using a Modified First Fit Decreasing Algorithm (see Wikipedia page) to decrease, on average, the number of floppy disks required.

Resources/Sources