GithubHelp home page GithubHelp logo

japawblob / luby-jones Goto Github PK

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

Imlpementation of Luby Jones algorythm for colouring graph.

CMake 0.01% C++ 0.64% Python 0.17% Makefile 0.03% Roff 99.15%
luby-s-algorithm openmp openmpi luby-jones-algorithm

luby-jones's Introduction

Luby Jones Algorytm

This repository is result of my work on Luby Jones algorythm, and it's parallelization. For basic functionality with serial computation and basic threaded implementation use this folder and use included cmake in order to run the program.

What is Luby Jones Algorithm?

Luby-Jones is based on Luby's algorithm, which is used for finding Maximal independent set. Luby-Jones is based on principle of finding independent sets, and iteratively colours graph.

How to use this program?

Program accepts following arguments:

  • -f [file_path], where file_path is input file. If left empty input will be taken from std::in. Input data has the following format: On first line are two unsigned integers A, B. Where A represents number of nodes and B represents number of edges. This line is followed by B lines, consisting of two unsigned integers C D, where C and D are connected nodes. For inspiration look into graph_generator and data_in folders.
  • -i [number_of_iterations] number of times the computation will be executed.
  • -p if this flag is enabled, program will run in parallel. Without this flag program runs in single threaded mode.

Comprehensive parallelization implemented in openMPI folder.

This repository also contains graph generator written in python, that can be used to generate your own graphs. It is located in graph_generator folder with its own readme.

After completing, program also generates .dot file in graphviz folder, which can be compiled to .png file using included Makefile.

Measurements:

Measurement were executed on commit b85d080. Hardware: i7-4770 - 4 cores 8 threads. OS: Kubuntu 22.04.1 LTS x86_64. Measurements were done on file located in /data_in/30000n-0.0015p-10h-0.02hp.in Serial:

iteration number: 0    Needed 314 ms to finish Serial.
iteration number: 1    Needed 326 ms to finish Serial.
iteration number: 2    Needed 308 ms to finish Serial.
iteration number: 3    Needed 310 ms to finish Serial.
iteration number: 4    Needed 311 ms to finish Serial.
Average time needed for Serial compute: 313ms. Number of colours: 120

Parallel:

iteration number: 0    Needed 86 ms to finish Parallel.
iteration number: 1    Needed 84 ms to finish Parallel.
iteration number: 2    Needed 86 ms to finish Parallel.
iteration number: 3    Needed 84 ms to finish Parallel.
iteration number: 4    Needed 83 ms to finish Parallel.
Average time needed for Parallel compute: 84ms. Number of colours: 120

Other recorded results:

Executed on Ryzen R3 PRO 5450U, in WSL2, OS: Ubuntu 20.04.5 LTS on Windows 10 x86_64 For input 10000n-0.995p.in

iteration number: 0    Needed 4933 ms to finish parallel.
iteration number: 1    Needed 5597 ms to finish parallel.
iteration number: 2    Needed 5742 ms to finish parallel.
iteration number: 3    Needed 4789 ms to finish parallel.
iteration number: 4    Needed 5104 ms to finish parallel.

iteration number: 0    Needed 13756 ms to finish serial.
iteration number: 1    Needed 13227 ms to finish serial.
iteration number: 2    Needed 16870 ms to finish serial.
iteration number: 3    Needed 16155 ms to finish serial.
iteration number: 4    Needed 12972 ms to finish serial.

For input 30000n-0.0015p-10h-0.02hp.in

iteration number: 0    Needed 106 ms to finish parallel.
iteration number: 1    Needed 89 ms to finish parallel.
iteration number: 2    Needed 95 ms to finish parallel.
iteration number: 3    Needed 74 ms to finish parallel.
iteration number: 4    Needed 71 ms to finish parallel.

iteration number: 0    Needed 451 ms to finish serial.
iteration number: 1    Needed 423 ms to finish serial.
iteration number: 2    Needed 417 ms to finish serial.
iteration number: 3    Needed 421 ms to finish serial.
iteration number: 4    Needed 402 ms to finish serial.

For input 50000n-0.06p.in

iteration number: 0    Needed 15408 ms to finish parallel.
iteration number: 1    Needed 14221 ms to finish parallel.
iteration number: 2    Needed 14405 ms to finish parallel.
iteration number: 3    Needed 15120 ms to finish parallel.
iteration number: 4    Needed 19956 ms to finish parallel.

iteration number: 0    Needed 67376 ms to finish serial.
iteration number: 1    Needed 63061 ms to finish serial.
iteration number: 2    Needed 61760 ms to finish serial.
iteration number: 3    Needed 61515 ms to finish serial.
iteration number: 4    Needed 62632 ms to finish serial.

luby-jones's People

Contributors

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