All Projects → alex-87 → HyperGraphLib

alex-87 / HyperGraphLib

Licence: MIT license
C++ Hypergraph modelling Library using Boost and OpenMP with some algorithms, including isomorphism using Gecode.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to HyperGraphLib

awesome-backend
🚀 A curated and opinionated list of resources (English & Russian) for Backend developers | Структурированный список ресурсов для изучения Backend разработки
Stars: ✭ 826 (+4247.37%)
Mutual labels:  computer-science
ft select
A robust file browser and manager in the terminal.
Stars: ✭ 14 (-26.32%)
Mutual labels:  school-project
curr
All curricular materials for Bootstrap course modules
Stars: ✭ 13 (-31.58%)
Mutual labels:  computer-science
cplex-scala
A scala library for IBM ILOG CPLEX
Stars: ✭ 20 (+5.26%)
Mutual labels:  constraint-programming
boost-reflection
This library provides Java-like Reflection API to C++ language.
Stars: ✭ 16 (-15.79%)
Mutual labels:  boost
Grafatko
An app for creating and visualizing graphs and graph-related algorithms.
Stars: ✭ 22 (+15.79%)
Mutual labels:  computer-science
DataStructures-Algorithms
A collections of many CP-based or DSA-based Questions that is stored various algorithms and datastructures to increase coding aptitutde. Anybody with a knack for coding can feel free to add more solutions and questions in the respective folders
Stars: ✭ 15 (-21.05%)
Mutual labels:  computer-science
conjure
Conjure: The Automated Constraint Modelling Tool
Stars: ✭ 84 (+342.11%)
Mutual labels:  constraint-programming
developkit set
2021年最新总结,值得推荐的c/c++开源框架与库。持续更新中。
Stars: ✭ 654 (+3342.11%)
Mutual labels:  boost
BackEnd-Squad
Back End Squad Roadmap
Stars: ✭ 24 (+26.32%)
Mutual labels:  computer-science
ez-rtos
A micro real-time operating system supporting task switching, delay function, memory allocator and critical section. It is writen on ARM Cortex-M3 assemble language, it runs successfully on STM32F103 MCU.
Stars: ✭ 57 (+200%)
Mutual labels:  computer-science
reading-material
Reading schedule and our library of pdfs
Stars: ✭ 19 (+0%)
Mutual labels:  computer-science
simsttab
Simple timetabling engine for schools
Stars: ✭ 21 (+10.53%)
Mutual labels:  constraint-programming
CS Offer
后台开发基础知识总结(春招/秋招)
Stars: ✭ 352 (+1752.63%)
Mutual labels:  computer-science
AlgorithmsAndDataStructure
Algorithms And DataStructure Implemented In Python, Java & CPP, Give a Star 🌟If it helps you
Stars: ✭ 724 (+3710.53%)
Mutual labels:  computer-science
CSIndex
Transparent data about Brazilian scientific production in Computer Science
Stars: ✭ 34 (+78.95%)
Mutual labels:  computer-science
HPX Projects
⚡ High-Performance-Computing with C++
Stars: ✭ 15 (-21.05%)
Mutual labels:  boost
tenacity
A computational thinking game to introduce functions, loops, conditions, and variables
Stars: ✭ 23 (+21.05%)
Mutual labels:  computer-science
awesome-readings
List of Awesome Research Articles on Computer Science and Technology
Stars: ✭ 25 (+31.58%)
Mutual labels:  computer-science
Codex
A free note-taking software for programmers and Computer Science students
Stars: ✭ 242 (+1173.68%)
Mutual labels:  computer-science

HyperGraphLib

Hypergraphs modelling library with algorithms, the official page for more informations.

hypergraph

How to build and install HyperGraphLib

In a terminal:

git clone https://github.com/alex-87/HyperGraphLib.git
cd HyperGraphLib
cmake CMakeLists.txt
make
make install #Some privileges could be required

See the official page for more informations :)

Where is the documentation ?

The documentation, generated using Doxygen is available at the technical documentation page.

Minimum required

To compile HyperGraphLib, you need:

Example

#include <iostream>
#include <boost/shared_ptr.hpp>
#include <Hypergraph/model/Hypergraphe.hh>
#include <Hypergraph/model/HyperFactory.hh>
#include <Hypergraph/model/MotorAlgorithm.hh>
#include <Hypergraph/algorithm/Isomorph.hh>
#include <Hypergraph/algorithm/Simple.hh>

int main(int argc, char * argv[]) {

    // Creating the hypergraph inside smart pointer
    boost::shared_ptr<HypergrapheAbstrait> ptrHpg( new Hypergraphe() );

    // Starting the create session
    HyperFactory::startSession(ptrHpg);

    // Creating the hyper-edges
    boost::shared_ptr<HyperEdge> ptrEdge1 ( HyperFactory::newHyperEdge() );
    boost::shared_ptr<HyperEdge> ptrEdge2 ( HyperFactory::newHyperEdge() );

    // Creating the hyper-vertexes
    boost::shared_ptr<HyperVertex> ptrVertexA( HyperFactory::newHyperVertex() );
    boost::shared_ptr<HyperVertex> ptrVertexB( HyperFactory::newHyperVertex() );

    // The hyper-vertex A is contained inside the hyper-edge 1
    HyperFactory::link(ptrVertexA, ptrEdge1);
    // The hyper-vertex B is contained inside the hyper-edge 2
    HyperFactory::link(ptrVertexB, ptrEdge2);

    // Adding the hyper-vertexes in the hypergraph
    ptrHpg->addHyperVertex( ptrVertexA );
    ptrHpg->addHyperVertex( ptrVertexB );

    // Adding the hyper-edges in the hypergraph
    ptrHpg->addHyperEdge(ptrEdge1);
    ptrHpg->addHyperEdge(ptrEdge2);

    // Creating the adjacent matrix inside the hypergraph
    ptrHpg->flush();

    // Closing the session
    HyperFactory::closeSession();


    // -- -- --


    // Initializing the Isomorphism algorithm with ptrHpg (twice, just for the example)
    boost::shared_ptr<AlgorithmeAbstrait> isomorphPtr( new Isomorph( ptrHpg , ptrHpg ) );

    // Setting the motor's algorithm
    MotorAlgorithm::setAlgorithme( isomorphPtr );

    // Running the motor
    MotorAlgorithm::runAlgorithme();

    // Getting the result
    RStructure r1( isomorphPtr->getResult() );

    if( r1.getBooleanResult() ) {
    	std::cout << "The hypergraph is isomorph with itself" << std::endl;
    }

    // -- -- --

    // Initializing the Simple algorithm with ptrHpg (twice, just for the example)
    boost::shared_ptr<AlgorithmeAbstrait> simplephPtr( new Simple( ptrHpg ) );

    // Setting the motor's algorithm
    MotorAlgorithm::setAlgorithme( simplephPtr );

    // Running the motor
    MotorAlgorithm::runAlgorithme();

    // Getting the result
    RStructure r2( simplephPtr->getResult() );

    if( r2.getBooleanResult() ) {
        std::cout << "The hypergraph is simple." << std::endl;
    }

    return 0;
}

Compiling the example (Unix / Linux)

g++ example.cpp -o example -lhypergraph

The output is:

$ ./example
The hypergraph is isomorph with itself
The hypergraph is simple.

Boost Library

This software uses the Boost Library. Please see the Boost license at http://www.boost.org/LICENSE_1_0.txt

Gecode Library

This software uses the Gecode Library. Please see the Boost license at https://www.gecode.org/license.html

License

This software is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].