Coder Social home page Coder Social logo

delsquared / graph-misc-repo Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 208 KB

A miscellaneous repository for anything having to do with computation in the context of Graph Theory

Python 100.00%
graph-theory graph-algorithms graphs linear-algebra topology symbolic-computation numerical-computation data graph-traversal graph-theory-analysis algebraic-topology algebraic-graph-theory number-theory graph-misc topological-graph-theory information-theory statistics python

graph-misc-repo's Introduction

Graph Miscellaneous Repository

A miscellaneous repository for anything having to do with computation in the context of Graph Theory

Content:

1) Network of Squares

This section deals with the problem discussed my Matt Parker here, here and in his book "Things to Make and Do in the Fourth Dimension" with regards to his conjecture: That all consecutive integer sequences that exceed 25 can be rearranged such that the adjacent numbers sum to a square number, as well as 15, 16, 17, 23. One natural way to tackle this is using Hamiltonian paths on graphs like Parker did. A brute force search up to 299 was carried out by Charlie Turner and the code can be found here where the conjecture was found to hold.

This subsection is currently only serving as a "data collection" centre where various data about such graphs is collected for anyone who needs to do an analysis.

The characteristic polynomials

Due to the symbolic nature of the code and the size of the matrices undergoing the operations. I only managed to generate the characteristic polynomials C = det(A - xI) up to a degree of 34 and can be seen here. It is curious to note that quite a lot of adjacency matrices are singular (i.e. they are not invertible, det(A)=0, the polynomial has a y-intercept at 0). It is also interesting how rare odd-valued determinants are, even though the sample size is quite small.

The Edge, MinAvgMax-Degree countings

This was by far the easiest exhaustive lists to run. It basically counts the edges on each graph and finds the minimum, average and maximum degrees within the graph. Using the Handshake Lemma the script was made a bit more efficient by calculating the average degree directly from the number of edges as 2E/n. The list of the obtained values can be found here as well as a plot of the number of edges as a function of the number of edges.

The Graph "Entropy"

This result came out of a curiosity I had. Given that the Shannon Entropy is given by the sum of terms of the form -plog(p) or more simply as the expectation E[-log(p)], imagine being on a vertex v and choosing an edge randomly and uniformly (for whatever reason). the probability of choosing each node is p=1/deg(v). Now substituting this into the Shannon Entropy formula we would be summing terms of the form -plog(p) = log(deg(v))/deg(v). So I decided to investigate how this quantity changes with graph size. A .CSV file with the values can be found here and I plotted the values up to 500 and up to 1000 vertices.

It is evident that there is some sharp jittering for a low number of vertices and then smooths out for larger values which could be a promising indication that the Hamiltonicity of a graph could have some distant relation with this quantity.

Further Readings

2) More Sections Coming Soon

graph-misc-repo's People

Contributors

delsquared avatar

Stargazers

 avatar

Watchers

 avatar  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.