{"id":16275332,"url":"https://github.com/jakobbossek/grapherator","last_synced_at":"2025-03-20T01:30:57.985Z","repository":{"id":56937387,"uuid":"113013464","full_name":"jakobbossek/grapherator","owner":"jakobbossek","description":"A modular multi-step graph generator","archived":false,"fork":false,"pushed_at":"2021-09-29T11:24:21.000Z","size":10497,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-26T17:16:11.795Z","etag":null,"topics":["combinatorial-optimization","graph-generator","minimum-spanning-tree","multi-objective-optimization","optimization"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakobbossek.png","metadata":{"files":{"readme":"README.Rmd","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":"2017-12-04T08:04:30.000Z","updated_at":"2024-02-17T18:29:17.000Z","dependencies_parsed_at":"2022-08-21T01:10:29.507Z","dependency_job_id":null,"html_url":"https://github.com/jakobbossek/grapherator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobbossek%2Fgrapherator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobbossek%2Fgrapherator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobbossek%2Fgrapherator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobbossek%2Fgrapherator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakobbossek","download_url":"https://codeload.github.com/jakobbossek/grapherator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219865974,"owners_count":16555917,"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":["combinatorial-optimization","graph-generator","minimum-spanning-tree","multi-objective-optimization","optimization"],"created_at":"2024-10-10T18:33:03.517Z","updated_at":"2024-10-10T18:33:04.250Z","avatar_url":"https://github.com/jakobbossek.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n# grapherator: Modular graph generation\n\n\u003c!-- badges: start --\u003e\n[![DOI](http://joss.theoj.org/papers/10.21105/joss.00528/status.svg)](https://doi.org/10.21105/joss.00528)\n[![CRAN Status Badge](http://www.r-pkg.org/badges/version/grapherator)](http://cran.r-project.org/web/packages/grapherator)\n[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grapherator)](http://cran.rstudio.com/web/packages/grapherator/index.html)\n[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/grapherator?color=orange)](http://cran.rstudio.com/web/packages/grapherator/index.html)\n[![R-CMD-check](https://github.com/jakobbossek/grapherator/workflows/R-CMD-check/badge.svg)](https://github.com/jakobbossek/grapherator/actions)\n[![Codecov test coverage](https://codecov.io/gh/jakobbossek/grapherator/branch/master/graph/badge.svg)](https://codecov.io/gh/jakobbossek/grapherator?branch=master)\n\u003c!-- badges: end --\u003e\n\n## Introduction\n\nDue to lack of real world data comparisson of algorithms for graph problems is most often carried out on artificially generated graphs. The R package **grapherator** implements a modular approach to benachmark graph generation focusing on undirected, weighted graphs. The graph generation process follows a three-step procedure: \n\n1) Node generation,\n2) edge generation and finally \n3) edge weight generation. \n\nEach step may be repeated multiple times with different generators before the transition to the next step is conducted.\n\n## Example\n\nHere, we first generate a bi-criteria complete graph with n = 25 nodes and each two conflicting weights per edge. The first weight is the Euclidean distance of node coordinates in the Euclidean plane [0, 10] x [0, 10]. The second objective follows a N(5, 1.5)-distribution, i.e., a normal distribution with mean 5 and standard deviation 1.5. \n```r\nset.seed(1)\ng1 = graph(lower = 0, upper = 10)\ng1 = addNodes(g1, n = 25, generator = addNodesUniform)\ng1 = addWeights(g1, generator = addWeightsDistance, method = \"euclidean\")\ng1 = addWeights(g1, generator = addWeightsRandom, method = rnorm, mean = 5, sd = 1.5)\nprint(g1)\ndo.call(gridExtra::grid.arrange, plot(g1))\n```\n\nThe next example demonstrates multiple iterations of each step to create a complex, clustered, connected network with different edge generators applied for establishing links within clusters and between cluster centers respectively. Detailed description: First, 10 cluster centers are placed via Latin-Hypercube-Sampling (LHS). Next, each cluster is crowded with 29 additional nodes by uniform sampling around the cluster center. Edge generation is done by randomly adding an edge between each two nodes in a cluster with small probability p = 0.2. To ensure connectivity, the spanning tree edge generator is applied. The last step of edge generation connects the clusters via Delauney triangulation. In a final step, two negatively correlated weights are added.\n```r\nset.seed(1)\ng2 = graph(lower = 0, upper = 100)\ng2 = addNodes(g2, n = 10, generator = addNodesLHS)\ng2 = addNodes(g2, n = 29, by.centers = TRUE, generator = addNodesUniform, lower = c(0, 0), upper = c(5, 5))\ng2 = addEdges(g2, type = \"intracluster\", generator = addEdgesGilbert, p = 0.2)\ng2 = addEdges(g2, type = \"intracluster\", generator = addEdgesSpanningTree)\ng2 = addEdges(g2, type = \"intercenter\", generator = addEdgesDelauney)\ng2 = addWeights(g2, generator = addWeightsCorrelated, rho = -0.7)\nprint(g2)\ndo.call(gridExtra::grid.arrange, plot(g2))\n```\n\nThe following image shows both example graphs `g1` and `g2`. The topology is shown in the left column, while a scatterplot of the weights is visualized in the right column.\n\n![Example graphs](https://raw.githubusercontent.com/jakobbossek/grapherator/master/images/README_graphs.png)\n\nSee the package vignettes for more examples and thorough description.\n\n## Installation Instructions\n\nInstall the [CRAN](http://cran.r-project.org) release version via:\n```r\ninstall.packages(\"grapherator\")\n```\nIf you are interested in trying out and playing around with the current development version use the [devtools](https://github.com/hadley/devtools) package and install directly from GitHub:\n\n```r\ninstall.packages(\"devtools\", dependencies = TRUE)\ndevtools::install_github(\"jakobbossek/grapherator\")\n```\n\n## Contributing to grapherator\n\nIf you encounter problems using this software, e.g., bugs or insufficient/misleading documentation, or you simply have a question, feel free to open an issue in the [issue tracker](https://github.com/jakobbossek/grapherator/issues).\nIn order to reproduce potential problems, please provide a minimal and reproducible code example.\n\nContributions to this software package are welcome via [pull requests](https://help.github.com/articles/about-pull-requests/) and will be merged at the sole discretion of the author. \n\n## Related work\n\nThe following R packages provide some methods to generate random graphs:\n\n* [igraph: Network Analysis and Visualization](https://cran.r-project.org/package=igraph) Includes some methods to generate classical Erdos-Renyi random graphs as well as more recent models, e.g., small-world graphs.\n* [netgen: Network Generator for Combinatorial Graph Problems](https://cran.r-project.org/package=netgen) Contains some methods to generate complete graphs especially for benchmarking Travelling-Salesperson-Problem solvers.\n* [bnlearn: Bayesian Network Structure Learning, Parameter Learning and Inference](https://cran.r-project.org/web/packages/bnlearn/index.html) Function `bnlearn::random.graph` implements some algorithms to create graphs.\n\nMore interesting libraries:\n\n* [Graphcuisine](http://www.aviz.fr/Research/Graphcuisine) Provides an interactive Evolutionary Algorithm to create random graphs with certain user-guided characteristics or maximal similarity to a given baseline graph.\n* [NetworkX](https://networkx.github.io) Powerful python package which provides many methods to generate classic and random networks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakobbossek%2Fgrapherator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakobbossek%2Fgrapherator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakobbossek%2Fgrapherator/lists"}