{"id":15355839,"url":"https://github.com/fibo/iper","last_synced_at":"2025-08-08T23:13:18.549Z","repository":{"id":9705664,"uuid":"11657386","full_name":"fibo/iper","owner":"fibo","description":"Hypergraphs for breakfast","archived":false,"fork":false,"pushed_at":"2020-01-24T01:12:47.000Z","size":538,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T17:11:11.742Z","etag":null,"topics":["graph-theory","hypergraph"],"latest_commit_sha":null,"homepage":"http://g14n.info/iper/","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/fibo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["fibo"],"patreon":"fibo"}},"created_at":"2013-07-25T09:56:44.000Z","updated_at":"2024-05-31T06:49:01.000Z","dependencies_parsed_at":"2022-07-08T00:50:33.349Z","dependency_job_id":null,"html_url":"https://github.com/fibo/iper","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fiper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fiper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fiper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibo%2Fiper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibo","download_url":"https://codeload.github.com/fibo/iper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519541,"owners_count":21117761,"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","hypergraph"],"created_at":"2024-10-01T12:25:52.479Z","updated_at":"2025-04-15T06:37:46.267Z","avatar_url":"https://github.com/fibo.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fibo","https://patreon.com/fibo"],"categories":[],"sub_categories":[],"readme":"# iper\n\n\u003e Hypergraphs for breakfast!\n\n[Installation](#installation) |\n[API](#api) |\n[Examples](#examples) |\n[License](#license)\n\n[![Node engine](https://img.shields.io/node/v/iper.svg)](https://nodejs.org/en/) [![NPM version](https://badge.fury.io/js/iper.svg)](http://badge.fury.io/js/iper) [![Build Status](https://travis-ci.org/fibo/iper.svg?branch=master)](https://travis-ci.org/fibo/iper?branch=master) [![Dependency Status](https://gemnasium.com/fibo/iper.svg)](https://gemnasium.com/fibo/iper) [![Coverage Status](https://coveralls.io/repos/fibo/iper/badge.svg?branch=master)](https://coveralls.io/r/fibo/iper?branch=master) [![Test page](https://img.shields.io/badge/test-page-blue.svg)](http://g14n.info/iper/test)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n[![NPM](https://nodei.co/npm-dl/iper.png)](https://nodei.co/npm-dl/iper/)\n\n## Installation\n\nWith [npm](https://npmjs.org/) do\n\n```bash\nnpm install iper\n```\n\n## API\n\n### `new Graph([graph])`\n\n\u003e Hypergraph constructor.\n\n```javascript\nconst Graph = require('iper').Graph\n\nconst graph = new Graph()\n```\n\n* **@param** `{Object}` [graph]\n* **@param** `{Object}` [graph.edges]\n* **@param** `{Object}` [graph.nodes]\n* **@param** `{Boolean}` [graph.multigraph] can contain duplicated edges\n* **@param** `{Boolean}` [graph.pseudograph] is a multigraph with loops allowed\n* **@param** `{Number}` [graph.uniform] all edges have the same cardinality (i.e. number of nodes)\n\n### `graph.addEdge(nodeIds)`\n\n\u003e Add an hyperedge that connects given nodeIds.\n\n* **@param** `{Array}` nodeIds\n* **@returns** `{String}` id\n\n### `graph.addNode(data)`\n\n\u003e Add a node, containing given data.\n\n```javascript\nvar nodeId = graph.addNode({ label: 'foo' })\n```\n\n* **@param** `{*}` [data]\n* **@returns** `{String}` id of the node created\n\n### `graph.degreeOf(nodeId)`\n\n\u003e Returns the degree of a node, that is the number of incident edges with loops counted twice.\n\n* **@param** `{String}` id\n* **@returns** `{void}`\n\n### `graph.delEdge(edgeId)`\n\n\u003e Delete edge by given id.\n\nThe node id will be removed from every edge connected.\nIf some edge after this operation will result having only one or zero\nvertices left, it will be removed too.\n\n* **@param** `{String}` edgeId\n* **@returns** `{void}`\n\n### `graph.delNode(nodeId)`\n\n\u003e Delete node by given id.\n\n* **@param** `{String}` nodeId\n* **@returns** `{void}`\n\n### `graph.generateId()`\n\n\u003e Returns a random string to be used as id.\n\n* **@returns** `{String}`\n\nOverride this method if you want to customize how ids are generated, for example\n\n```javascript\nconst uniqueid = require('lodash.uniqueid')\nconst Graph = require('iper').Graph\n\nclass MyGraph extends Graph {\n  generateId () {\n    return uniqueid()\n  }\n}\n\nmodule.exports = MyGraph\n```\n\n### `graph.getRank()`\n\n\u003e Returns the max cardinality of any of the edges in the hypergraph.\n\n* **@returns** `{Number}`\n\n## Examples\n\n### Classic graph\n\n```javascript\nconst Graph = require('iper').Graph\n\nconst classicGraph = new Graph({ uniform: 2 })\n```\n\n## License\n\n[MIT](http://www.g14n.info/mit-license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Fiper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibo%2Fiper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibo%2Fiper/lists"}