Code Monkey home page Code Monkey logo

scpxx's Introduction

SCPxx

build Codacy Badge License: MIT

A simple C++ library for reading Set Covering Problem (SCP) instances made available in OR-Library.

Installation

The installation require CMake to generate build files of the library.

Clone this repository, in command line, access the project directory. Create a folder to files generating by cmake.

$ mkdir build && cd build

Uses make to install locally the headers. In build directory, type

$ cmake ..
$ sudo make install

By default, the files are placed in /usr/local/include/scpxx/.

List of problems

Following problems existing in OR-Library that can be readed here are:

  • Set covering problem (SCP)

Usage

Example using matrix class for set covering problem:

#include <iostream>
#include <scpxx/scp.h>

using namespace scpxx;

int main() {
    SCPFile file("../scp41.txt");

    // Read all numbers in file and copy to a vector
    file.bufferize();

    // Get the vector with all numbers
    std::vector<int> vec = file.values();
    std::cout << "Number of values: " << vec.size() << std::endl;
    
    // The method generate_matrix build the matrix object
    auto matrix = file.generate_matrix();

    std::cout << matrix.num_rows() << " rows\n";
    std::cout << matrix.num_columns() << " columns\n";
    return 0;
}

License

Licensed under the MIT license.

scpxx's People

Contributors

ropinho avatar

Stargazers

 avatar  avatar

Watchers

 avatar

scpxx's Issues

Data Structures for the problems

Implement (or use existing) data stuctures (structs or classes) for represent the problems that exists in OR Library.

Example: The Set Covering problem (SCP) is represented here by a Matrix.

Some suggestions:

  • Item class (for the Knapsack problem);
  • Graph representing (for problemas such as Traveling salesman).
  • etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.