{"id":23802704,"url":"https://github.com/aritrakar/markov_chains","last_synced_at":"2025-07-12T03:06:49.647Z","repository":{"id":222418579,"uuid":"757229126","full_name":"aritrakar/markov_chains","owner":"aritrakar","description":"⛓️Finite-state discrete time Markov chain (DTMC) implementation.","archived":false,"fork":false,"pushed_at":"2024-02-16T01:55:31.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-01T22:30:52.739Z","etag":null,"topics":["cpp","eigen"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aritrakar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-14T03:55:37.000Z","updated_at":"2024-06-04T01:27:18.000Z","dependencies_parsed_at":"2025-01-01T22:27:36.702Z","dependency_job_id":"d3ba586b-f684-41c9-b0be-0183bc1c5f71","html_url":"https://github.com/aritrakar/markov_chains","commit_stats":null,"previous_names":["aritrakar/markov_chains"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritrakar%2Fmarkov_chains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritrakar%2Fmarkov_chains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritrakar%2Fmarkov_chains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritrakar%2Fmarkov_chains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aritrakar","download_url":"https://codeload.github.com/aritrakar/markov_chains/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240054048,"owners_count":19740763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","eigen"],"created_at":"2025-01-01T22:27:28.705Z","updated_at":"2025-02-21T16:59:00.166Z","avatar_url":"https://github.com/aritrakar.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markov Chain Implementation\n\nThis repository contains the code for a **finite-state discrete time Markov chain** implementation in **C++** using the **Eigen** library. It's a work in progress and serves to complement my learnings in my stochastic processes class using concepts from graph theory. It also serves as a practice project for using CMake and Googletest.\n\nNote that the files for Eigen were not uploaded.\n\n**Current capabilities:**\n\n1. Simulate $n$ steps of the Markov chain.\n1. Find communication classes.\n1. Find the steady state.\n1. Find the periodicity of states.\n\n**To do**\n\n1. Transcience and recurrence\n1. Mean recurrence time\n\n## Prerequisites\n\n1. C++17\n1. Make sure you've installed Eigen in a directory called `lib` in this project's directory (see [here](https://eigen.tuxfamily.org/dox/GettingStarted.html))\n1. CMake (optional, but recommended)\n\n## How to run the code?\n\n### Using CMake\n\n```bash\nmkdir build\ncd build\n\n# Configure CMake\ncmake ../\n\n# Generate build files\ncmake --build .\n\n# Execute\n# By Default, the executable is generated under `build/Debug`\n./Debug/mc.exe ../etc/tmp1.txt\n```\n\n### Using g++\n\nNote that the following will work directly on Linux or MacOS. However, for running on Windows, you'll probably need to use Powershell.\n\n```bash\n# Compile and generate executable\n# Format: g++ -O3 -o \u003cexecutable_name\u003e src/*.cpp -I \u003cpath to Eigen library\u003e\ng++ -O3 -o mc src/*.cpp -I./lib\n\n# Run executable\n./mc ./etc/tpm1.txt\n```\n\n### Testing\n\nThis project uses Googletest for testing. Assuming you have built everything correctly, to execute tests you need only do the following: `cd build \u0026\u0026 ctest`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faritrakar%2Fmarkov_chains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faritrakar%2Fmarkov_chains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faritrakar%2Fmarkov_chains/lists"}