Coder Social home page Coder Social logo

dpoliwhi / multithreads Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.14 MB

Implementation of ACO algorithm in parallel programming

C++ 98.47% Makefile 1.53%
aco-algorithm ant-colony-algorithm gauss-elimination mvc-architecture parallel-computing parallel-programming

multithreads's Introduction

drawing

Parallel programming

Implementation of several algorithms with parallel programming

The app allows you to measure the execution time of each algorithm when running in a single thread and in multithreaded mode

Architecture

The general architecture of the program is based on the MVC pattern, has a console interface, which is located in the Interface directory.
The main algorithms are located in the Model directory.


Algorithms

  • Ant colony optimization algorithm (ACO) to solve the traveling salesman problem
  • Winograd algorithm of matrix multiplication
  • Solving systems of linear equations (SLE) using the Gaussian elimination method

ACO algorithm

drawing

The algorithm will give the result of the route length closest to the minimum value.
A feature of the algorithm - the highest speed and maximum proximity to real life
Object-oriented approach allows you to repeat the life of an ant colony, reproduce the trip for food along the trails, choosing the path according to the pheromones left on the trail.

Files with graphs are located in the *datasets* directory and are presented as *.txt* files with adjacency matrices.
The application also allows you to convert *.txt* file to *.dot* file (item 2 of the main menu of the console interface)
To view the graph, you need to install the appropriate extension for the IDE (for example, Graphviz for VS Code)

Multithreads

Algo implemented in a simple way (without parallelism) and with Multithreads in Pipeline mode.
Pipelining is generally based on dividing the algorithm to be executed into smaller parts, called stages, and allocating a separate thread to each of them.

drawing


Winograd algorithm

drawing

The program allows you to enter the dimensions of matrices
Then you can choice the mode of input data (random or manual)

All input data is validated

Multithreads

Algo implemented in a simple way (without parallelism), with Pipeline parallelism and with Classic parallelism .

drawing

Classic parallelism divides the number of execution with the number of threads equal to 2, 4, 8, ..., 4 * (number of logical computer processors)


SLE algorithm

drawing

Algorithm allows you to enter SLE matrix manualy or load from file (datasets directory)

All input data is validated

Multithreads

Algo implemented in a simple way (without parallelism) and with Pipeline parallelism

drawing


Makefile

The root directory contains a Makefile with the following targets:

  • make ant - run ACO algorithm
  • make gauss - run SLE algorithm
  • make winograd - run Winograd algorithm
  • check / clang - starts checking all files for style norms, leaks, and cppcheck
  • clean - performs a complete cleanup of installation files

multithreads's People

Contributors

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