Skip to content

This repository contains the project of CMKV class at EPITA. The goal of the project is to provide a solver for a Tetravex game using a Metropolis-Hasting.

License

Notifications You must be signed in to change notification settings

Sefray/cmkv_epita

Repository files navigation

CMKV - Tetravex

This repository contains a Tetravex using the Metropolis-Hasting with recuit algorithm.

The proposed solution use recuit with multi-threading with as many thread as possible using diverse parameters.


Usage

make main
./aout in.txt [out.txt]

The second charactere of the name of the file 'in.txt' is the size of the grid of Tetravex. The size goes from 3 to 6 (included).

The in.txt and out.txt have on each line the value of the cell in the following order: NORTH - WEST - EAST - SOUTH

As an example, the following grid :

corresponds to the file : s3-board.txt
4745
6356
5135
6522
0186
8634
8000
3300
0416

Testing (criterion)

Testing includes both functionnal tests and unit tests (using Criterion)

make check

Benchmark (google-benchmark)

Benchmarks are computed on 10 files for each possible size of Tetravex.

make bench
./bench
Running ./bench
Run on (12 X 2208.01 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x6)
  L1 Instruction 32 KiB (x6)
  L2 Unified 256 KiB (x6)
  L3 Unified 9216 KiB (x1)
Load Average: 350.37, 245.65, 99.42
-------------------------------------------------------------------------
Benchmark               Time             CPU   Iterations UserCounters...
-------------------------------------------------------------------------
BM_Tetravex_s2      0.020 s         0.005 s           127 items_per_second=1.85682k/s
BM_Tetravex_s3      0.044 s         0.009 s            74 items_per_second=1.20834k/s
BM_Tetravex_s4      0.106 s         0.007 s           101 items_per_second=1.51342k/s
BM_Tetravex_s5      0.279 s         0.009 s            10 items_per_second=950.73/s
BM_Tetravex_s6       2.77 s         0.022 s            10 items_per_second=507.76/s

About

This repository contains the project of CMKV class at EPITA. The goal of the project is to provide a solver for a Tetravex game using a Metropolis-Hasting.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published