{"id":17160299,"url":"https://github.com/codenameyau/directed-graph","last_synced_at":"2025-04-13T14:10:09.624Z","repository":{"id":24497201,"uuid":"27902336","full_name":"codenameyau/directed-graph","owner":"codenameyau","description":":package: Node.js weighted directed graphs","archived":false,"fork":false,"pushed_at":"2014-12-14T03:37:13.000Z","size":216,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T14:09:57.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/codenameyau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-12T02:44:11.000Z","updated_at":"2021-08-12T18:14:21.000Z","dependencies_parsed_at":"2022-09-03T12:23:02.876Z","dependency_job_id":null,"html_url":"https://github.com/codenameyau/directed-graph","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/codenameyau%2Fdirected-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fdirected-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fdirected-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenameyau%2Fdirected-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenameyau","download_url":"https://codeload.github.com/codenameyau/directed-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724629,"owners_count":21151561,"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":[],"created_at":"2024-10-14T22:24:24.591Z","updated_at":"2025-04-13T14:10:09.593Z","avatar_url":"https://github.com/codenameyau.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"directed-graph\n==============\n\nnode package for weighted directed graphs\n\n###Installation\n\n`npm install directed-graph --save`\n\n\n##Quickstart\n\n```javascript\nvar Graph = require('directed-graph');\n\n// Either initialize and fill an empty graph\nvar graphA = new Graph();\ngraphA.addVertex('A');\ngraphA.addVertex('B');\ngraphA.addVertex('C');\ngraphA.addEdge('A', 'B');\ngraphA.addEdge('A', 'C');\ngraphA.addEdge('B', 'A');\ngraphA.addEdge('B', 'C');\ngraphA.addEdge('C', 'A');\ngraphA.addEdge('C', 'B');\n\n// Or predefine a new graph\nvar graphB = new Graph({\n  'A': ['B', 'C'],\n  'B': ['A', 'C'],\n  'C': ['A', 'B'],\n});\n\n// Both graphA and graphB function the same\ngraphA.setWeight('A', 'B', 10);\ngraphA.setWeight('B', 'A', 10);\ngraphA.addVertex('D');\ngraphA.addEdge('A', 'D');\nconsole.log(graphA.pathExists('B', 'D'));\n```\n\n##Running Tests\nMake sure to have mocha installed: `npm install -g mocha`\n\nIn project root directory, run: `mocha test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameyau%2Fdirected-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenameyau%2Fdirected-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenameyau%2Fdirected-graph/lists"}