Coder Social home page Coder Social logo

graceful-graphs-package's Introduction

=======

Graceful Graph Package

We provide here a sagemath implementation of the graceful graph package UPDATE 2016-05-03

The Graceful Graph Package is a combinatorial package designed to investigate structural and combinatorial properties graphs with n-1 edges which admit graceful labelings.

Installation

A properly working install of SageMath Version 7.1 is a prerequisite to using the graceful graph package. Download the sage file into your working directory. Load the package into a sage terminal session using the following command:

sage: %runfile graceful_graph_package.sage

Usage

The following goes through all the permutation of n>1 elements and outputs the list of permutations which can be used for constructing graceful graphs.

sage: GracefulPermutations(4)
[[0, 1, 2, 3], [0, 2, 1, 3]]

The following goes through all the permutation of n>1 elements and outputs the list of of functions derived from graceful permutations.

sage: CountGracefulFunctions(4)
[[2, [0, 1, 2, 3]], [2, [0, 2, 1, 3]]]

The following goes through all the permutation of n>1 elements and outputs the list of of functions on the vertices derived from graceful permutations.

sage: GracefulFunctionsTuples(3)
[[[[(0, 0), (1, 2), (2, 0)], [(0, 0), (1, 0), (2, 0)]], [0, 1, 2]]]

The following converts a list of tuples associated with directed edges to list of symbolic expression associated with the edges

sage: Tuple2EdgeList([(0, 0), (1, 2), (2, 0)], 'x')
[0, x1 - x2, -x0 + x2]

The following saves in the working directory png files associated with drawings of all gracefully labeled graphs having n-1 edges where n is the input

sage: for l in GracefulDiGraphList(5):
....:     t=0
....:     for dg in l[0]:
....:         dg.plot().save(str(l[1]).replace(', ','_').replace('[','').replace(']','')+'__'+str(t)+'.png')
....:         t=t+1
....:

The following saves only the ones which are trees.

sage: for l in GracefulDiTreeList(5):
....:     t=0
....:     for dg in l[0]:
....:         dg.plot().save(str(l[1]).replace(', ','_').replace('[','').replace(']','')+'__'+str(t)+'.png')
....:         t=t+1
....:

The following saves only the ones which are generator trees.

sage: for l in GeneratorGracefulTreeDiGraphList(5):
....:     t=0
....:     for dg in l[0]:
....:         dg.plot().save(str(l[1]).replace(', ','_').replace('[','').replace(']','')+'__'+str(t)+'.png')
....:         t=t+1
....:

(to be continued ...)

Bug report

Please report any bugs, it is greatly appreciated.

graceful-graphs-package's People

Contributors

kgnang avatar

Watchers

 avatar  avatar

Forkers

shanhaiying

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.