Giter VIP home page Giter VIP logo

chordless-graphs-generator's Introduction

Graphs without chordless cycles of given lengths

find_cycles.cpp

Compile as g++ -std=c++11 find_cycles.cpp.

What it does:

The program takes a set of circle lengths X and an undirected graph G as an input and:

  1. Determines whether it contains a chordless cycle of such a length that is in X.

  2. If it doesn't (i.e. the first condition isn't fulfilled), determines whether G contains an edge e for which G-e fulfills the condition 1. Such an edge we will call critical.

Input format:

The first line contains one positive integer K. The next line contains K positive integers - the lengths of the chordless cycles to find.

On the next line there are two space separated integers N and M, N specifying the number of vertices of the graph G and M the number of edges. M lines follow, each in a format "X Y" meaning that there is a undirected edge from vertex X to vertex Y. Vertices are numbered from 0 to N-1.

Output format:

One line containing one of the 3 possible output messages, specifically:

  • "G contains a chordless cycle of length in X"
  • "G contains a critical edge"
  • "G doesn't contain a critical edge"

gen.cpp

This program requires nauty. It has been built using version 26r7, but newer versions will hopefully be compatible.

Compile as g++ gen.cpp nauty26r7/nauty.a.

What it does:

The program generates all (unlabeled) undirected graphs up to some reasonably small number of vertices defined in a constant MAX_VERTICES. Optionally, it can generate graphs without chordless cycles of given lengths. The program uses nauty representation of dense graphs as specified in nauty documentation.

Input format:

The first line contains one positive integer N. On the next line there are N space separated integers representing the unwanted lengths of chordless cycles of generated graphs.

Output format:

As for now, the only output is the number of graphs that have been generated. All generated graphs are put to the std::queue, hence the output says "There are X graphs in the queue".

chordless-graphs-generator's People

Contributors

gogis0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.