{"id":21028482,"url":"https://github.com/dirkschumacher/rcbc","last_synced_at":"2025-05-15T10:33:26.007Z","repository":{"id":45026940,"uuid":"73627044","full_name":"dirkschumacher/rcbc","owner":"dirkschumacher","description":"COIN-OR branch and cut (CBC) bindings for R","archived":false,"fork":false,"pushed_at":"2024-11-12T22:39:19.000Z","size":243,"stargazers_count":20,"open_issues_count":10,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-12T23:27:48.928Z","etag":null,"topics":["cbc","coin","integer-programming","linear-programming","r","solver"],"latest_commit_sha":null,"homepage":"https://dirkschumacher.github.io/rcbc/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirkschumacher.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":"2016-11-13T16:10:42.000Z","updated_at":"2024-09-11T07:43:46.000Z","dependencies_parsed_at":"2023-02-08T07:31:03.985Z","dependency_job_id":null,"html_url":"https://github.com/dirkschumacher/rcbc","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/dirkschumacher%2Frcbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Frcbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Frcbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirkschumacher%2Frcbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirkschumacher","download_url":"https://codeload.github.com/dirkschumacher/rcbc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225346426,"owners_count":17459977,"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":["cbc","coin","integer-programming","linear-programming","r","solver"],"created_at":"2024-11-19T11:55:49.388Z","updated_at":"2024-11-19T11:55:50.040Z","avatar_url":"https://github.com/dirkschumacher.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# CBC bindings for R\n\u003c!-- badges: start --\u003e\n[![Lifecycle: experimental](https://img.shields.io/badge/Lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![check-Ubuntu](https://img.shields.io/github/actions/workflow/status/dirkschumacher/rcbc/check-ubuntu.yaml?branch=master\u0026label=Ubuntu)](https://github.com/dirkschumacher/rcbc/actions)\n[![check-Windows](https://img.shields.io/github/actions/workflow/status/dirkschumacher/rcbc/check-windows.yaml?branch=master\u0026label=Windows)](https://github.com/dirkschumacher/rcbc/actions)\n[![check-macOS](https://img.shields.io/github/actions/workflow/status/dirkschumacher/rcbc/check-macos.yaml?branch=master\u0026label=macOS)](https://github.com/dirkschumacher/rcbc/actions)\n[![Documentation](https://img.shields.io/github/actions/workflow/status/dirkschumacher/rcbc/documentation.yaml?branch=master\u0026label=Documentation)](https://github.com/dirkschumacher/rcbc/actions)\n[![Coverage Status](https://img.shields.io/codecov/c/github/dirkschumacher/rcbc?label=Coverage)](https://app.codecov.io/github/dirkschumacher/rcbc?branch=master)\n[![CRAN status](https://www.r-pkg.org/badges/version/rcbc)](https://CRAN.R-project.org/package=rcbc)\n\u003c!-- badges: end --\u003e\n\nThe _rcbc_ package provides an interface to the [_CBC_ (COIN-OR branch and cut)](https://github.com/coin-or/Cbc) solver. Specifically, _CBC_ is an open-source mixed integer programming solver that is developed as part of the [Computational Infrastructure for Operations Research (COIN-OR) project](https://www.coin-or.org/). By interfacing with the _CBC_ solver, the _rcbc_ package can be used to generate optimal solutions to optimization problems. Please note that this package is under active development and is still a work in progress.\n\n## Installation\n\nThe package is not yet available on [The Comprehensive R Archive Network](https://cran.r-project.org/). To install this package, please use the following _R_ code to install it from the [source code repository on GitHub](https://github.com/dirkschumacher/rcbc). Please note that [CBC solver](https://github.com/coin-or/Cbc) header and library files also need be installed prior to installing this _R_ package (see below for details).\n\n```{r, eval = FALSE}\nif (!require(remotes))\n  install.packages(\"remotes\")\nremotes::install_github(\"dirkschumacher/rcbc\")\n```\n\n### Windows\n\nThe package can be installed from source when the [Rtools](https://cran.r-project.org/bin/windows/Rtools/) software is installed. Specifically, the [CBC solver](https://github.com/coin-or/Cbc) header and library files are automatically downloaded from [RWinLib](https://github.com/rwinlib/cbc).\n\n### Linux\n\n#### Debian/Ubuntu\n\nThe following system command can be used to install dependences.\n\n```\nsudo apt-get install coinor-libcbc-dev coinor-libclp-dev\n```\n\n#### Fedora\n\nThe following system command can be used to install dependencies.\n\n```\nsudo yum install coin-or-Cbc-devel coin-or-Clp-devel\n```\n\n### macOS\n\nThe following system command can be used to install dependencies using [Homebrew package manager](https://brew.sh/). After installing CBC and its dependencies, they need to linked in order to install the _rcbc_ package. **Please note that if you have previously installed these software, then they will be overwritten with the newer versions.**\n\n```\nbrew tap coin-or-tools/coinor\nbrew install coin-or-tools/coinor/cbc\nbrew link cbc --force\nbrew link coinutils --force\nbrew link osi --force\nbrew link clp --force\nbrew link cgl --force\n```\n\n## Usage\n\nHere we will provide a brief example showing how the package can be used to solve an optimization problem (see [package vignette](https://dirkschumacher.github.io/rcbc/articles/rcbc.html) for more details).\n\n```{r}\n# load package\nlibrary(rcbc)\n\n# define optimization problem and solve it\n## max 1 * x + 2 * y\n## s.t.\n##   x + y \u003c= 1\n##   x, y binary\nresult \u003c- cbc_solve(\n obj = c(1, 2),\n mat = matrix(c(1, 1), ncol = 2, nrow = 1),\n is_integer = c(TRUE, TRUE),\n row_lb = -Inf, row_ub = 1, max = TRUE,\n col_lb = c(0, 0), col_ub = c(1, 1),\n cbc_args = list(\"SEC\" = \"1\"))\n\n# extract solution status\nsolution_status(result)\n\n# extract solution values\ncolumn_solution(result)\n\n# extract objective value for solution\nobjective_value(result)\n```\n\n## ROI plugin\n\nThere is now a work in progress [ROI plugin](https://github.com/dirkschumacher/ROI.plugin.cbc).\n\n## Contribution\n\nFeel free to open issues and send pull requests.\n\n## Citation\n\nPlease cite the _rcbc_ R package and the [CBC solver](https://github.com/coin-or/Cbc) in publications.\n\n```{r, echo  = FALSE, result = \"asis\", comment = \"\"}\ncitation(\"rcbc\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkschumacher%2Frcbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirkschumacher%2Frcbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirkschumacher%2Frcbc/lists"}