Coder Social home page Coder Social logo

franciscofpereira / supermarble Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 322 KB

Marble plate slicing algorithm that optimizes profit and reduces waste. First project for Analysis and Synthesis of Algorithms class.

C++ 100.00%
dynamic-programming knapsack-problem bin-packing-problem profit-maximization

supermarble's Introduction

SuperMarble

Description

This project was the first one developed for the class of Analysis and Synthesis of Algorithms, taken during the first semester of the second year of my bachelor's degree @IST.

Objective

Maximize the profit that can be extracted from a rectangular marble sheet when cutting it into smaller rectangular pieces. The approach to solving this problem is similar to the one used in the knapsack problem. A dynamic programming approach is employed to avoid recomputing optimal solutions to subproblems.

  • Refer to the file p1.pdf for the project's instructions and details.
  • Refer to the file relatorio_supermarble.pdf for the full report on the solution's time complexity and description.

Source Code: The source code for the problem's solution is in proj1.cpp.

To compile proj1.cpp, use:

g++ -std=c++11 -O3 -Wall proj1.cpp -lm

Unit Tests: To generate unit test files for the problem, compile and run gen_supermarble.cpp.

To compile gen_supermarble.cpp, use:

g++ -std=c++11 -O3 -Wall -o gen_supermarble gen_supermarble.cpp -lm

To run gen_supermarble.cpp and create a unit test file, use:

./gen_supermarble N M P > testfile (where N and M are the dimensions of the marble sheet, P the number of pieces and testfile the name of the unit test)

supermarble's People

Contributors

franciscofpereira avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.