{"id":21065512,"url":"https://github.com/sebtee/how-monochromatic","last_synced_at":"2025-10-29T13:47:56.839Z","repository":{"id":39626054,"uuid":"442286332","full_name":"SebTee/how-monochromatic","owner":"SebTee","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-11T22:34:53.000Z","size":6278,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T21:11:47.630Z","etag":null,"topics":["graph-theory","haskell"],"latest_commit_sha":null,"homepage":"https://sebtee.github.io/how-monochromatic/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SebTee.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null}},"created_at":"2021-12-27T22:19:42.000Z","updated_at":"2022-06-23T15:11:16.000Z","dependencies_parsed_at":"2022-09-17T03:13:42.559Z","dependency_job_id":null,"html_url":"https://github.com/SebTee/how-monochromatic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebTee%2Fhow-monochromatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebTee%2Fhow-monochromatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebTee%2Fhow-monochromatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebTee%2Fhow-monochromatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SebTee","download_url":"https://codeload.github.com/SebTee/how-monochromatic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243509641,"owners_count":20302247,"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":["graph-theory","haskell"],"created_at":"2024-11-19T17:55:25.412Z","updated_at":"2025-10-29T13:47:51.791Z","avatar_url":"https://github.com/SebTee.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# how-monochromatic\n\n[![Haskell CI](https://github.com/SebTee/how-monochromatic/actions/workflows/haskell.yml/badge.svg)](https://github.com/SebTee/how-monochromatic/actions/workflows/haskell.yml)\n\nA tool to analyse [bi-coloured graphs](https://mariokrenn.wordpress.com/graph-theory-question/) and determine how close to being monochromatic they are.\n\n[Documentation](https://sebtee.github.io/how-monochromatic/)\n\n## Installation Guide\n\nYou need to have the [Haskell Tool Stack](https://haskellstack.org) installed.\n\nRun the following commands:\n```bash\ngit clone https://github.com/SebTee/how-monochromatic.git\ncd ./how-monochromatic\nstack install\n```\n\n## User Guide\n\nThe installed executable can be run by running `howmono` on the command line.\nIt takes no command line arguments.\nIt only reads a string encoded bi-coloured graph from the stdin.\nThe string encoding of the bi-coloured graph is defined in the\n[ParseBCG documentation](https://sebtee.github.io/how-monochromatic/how-monochromatic-0.1.0.0/ParseBCG.html#v:parse)\n(See the example `g.txt` file below).\n\nThe program will return a value between 0 and 1.\nThe closer to 1 the returned value is the closer to being monochromatic the input bi-coloured graph is.\n\n### Example Command\n\nThe following command reads the bi-coloured graph from the `g.txt` file and \npipes it into the stdin of the `howmono` executable.\n\n```bash\ncat ./g.txt | howmono\n```\n\nContents of `g.txt`\n```\n1 green 2 green 1 0\n1 blue  3 blue  1 0 \n1 red   4 green 0 1 \n1 red   6 red   1 0 \n2 red   3 red   1 0 \n2 blue  5 blue  1 0 \n3 green 4 green 1 0 \n3 green 6 red   0 1 \n4 red   5 red   1 0 \n4 red   6 green 0 1 \n4 blue  6 blue  1 0 \n5 green 6 green 1 0\n```\n\nThis example will return `0.5`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebtee%2Fhow-monochromatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebtee%2Fhow-monochromatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebtee%2Fhow-monochromatic/lists"}