Giter Club home page Giter Club logo

text-formatting-problem's Introduction

Advanced-Algorithms

The objective is to implement algorithms for solving text formatting problems (Printing Neatly), and to provide an experimental study of their running time and the quality of the solutions found. This is a problem of neatly printing a paragraph with a mono-spaced font (all characters having same width) on a printer. The input text is a sequence of n words of lengths l1, l2, ....., ln, measured in characters. The idea is to print this paragraph neatly on a number of lines that hold a maximum of M characters each. The study of this problem is done by programming different algorithms and then, three types of alignments are explored, namely left, center and right. The following algorithms were used in this project:

  1. Dynamic programming
  2. Greedy approach
  3. Branch and Bound
  4. Divide and conquer
  5. Binary search
  6. Shortest path
  7. Brute force approach

The efficiency of every algorithm was studied by calculating a cost which is defined as the cube of empty spaces in a line. Then the algorithms were tested with different text paragraphs like:

  1. Case Study 1 : Low word count
  2. Case Study 2 : Random Paragraphs
  3. Case Study 3 : Fixed character paragraph
  4. Case Study 4 : Fixed word paragraph

Runtime, cost and quality of every algorithm was found for the final analysis.

text-formatting-problem's People

Contributors

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