GithubHelp home page GithubHelp logo

n1sl / longestuncrossedknightspath Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tim-seidel/longestuncrossedknightspath

0.0 0.0 0.0 342 KB

A project in the module "Parallel and distributed algorithms" at the University of Applied Sciences in Osnabrueck to calculate the longest uncrossed knights path on a chessboard of the size m x n.

C++ 100.00%

longestuncrossedknightspath's Introduction

Longest uncrossed closed knight's path algorithm

The longest uncrossed closed knight's path is a mathematical problem involving a knight on the standard NxM chessboard. The problem is to find the longest path the knight can take on the given board, such that the path does not intersect itself. In addition, the path must be closed. Thus it ends at the same place where it begins.

This was a project in the module "Parallel and distributed algorithms" at the University of Applied Sciences in Osnabrueck.

General approach:

  • Optimize start fields and moves by tacking symmetries into account.
  • Run the algorithm for all start configurations that are relvant.
  • Use backtracking to run over all path and move possibilities.
  • Store the data in a chessboard that contains all information. A field contains the binary information for all possible 8 moves (8 bits total). Each bit means 1: move is used 0: move is not used. For cross detection of a new move all relevant neighbours are checked whether they contain moves that would lead to a crossing path. This is done by bitoperations with the field data. For more information about the moves and relevant neightbours check the doc/ folder. This leads to an overall fast and optimized calculation. Reference time for the fastest 8x8 chessboard time: ~9.6 seconds.

sequential

Sequential implementation of the problem.

parallel-for

Parallel implementation using intels tbb::parallel_for approach.

parallel-tasks

Parallel implementation using intels tbb::task approach.

longestuncrossedknightspath's People

Contributors

tim-seidel 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.