Giter Site home page Giter Site logo

exercise_06's Introduction

Restriction maps

Task 1 - Double Digest Problem (DDP)

  • In R, create a function for the brute-force DDP algorithm for one possible arrangement of fragments.
  • Modify it to work with all possible arrangements of fragments.

Task 2 - Partial Digest Problem (PDP)

Implement recursive function for PDP algorithm according to following pseudocode:

PartialDigestProblem(deltaX)
1 width ← the maximum element from deltaX
2 delete the maximum element from deltaX
3 X ← {0, width}
4 Place(deltaX, X, width)

Place(deltaX, X, width)
1   if deltaX is empty
2     output X
3     return
4   y ← the maximum element from deltaX
5   if Δ(y, X) ⊆ deltaX
6     add y to X and remove the lengths Δ(y, X) from deltaX
7     Place(deltaX, X, width)
8     remove y from X and add the lengths Δ(y, X) to deltaX
9   if Δ(width - y, X) ⊆ deltaX
10    add width - y to X and remove the lengths Δ(width - y, X) from deltaX
11    Place(deltaX, X, width)
12    remove width - y from X and add the lengths Δ(width - y, X) to deltaX
13  return

Notes:

  • deltaX = ΔX = multiset of fragments lengths
  • Δ(y, X) is a multiset of lengths between value y and all values in X.
  • Hint: Create additional function Remove(), which removes from deltaX all used lengths Δ(y, X).

exercise_06's People

Contributors

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