1 / 72

Graph Colouring

Graph Colouring. Various Models. an obvious model SAT sets demo random graphs chromatic number maxCol phase transition. kCol. We are given a graph G = (V,E) where V is set of vertices and E is set of edges G is simple, undirected graph.

makan
Download Presentation

Graph Colouring

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graph Colouring Various Models

  2. an obvious model • SAT • sets • demo • random graphs • chromatic number • maxCol • phase transition

  3. kCol We are given a graph G = (V,E) where V is set of vertices and E is set of edges G is simple, undirected graph Given k colours, can we label vertices with colours such that for all (i,j)  E  colour(i) ≠ colour(j)

  4. A Graph G = (V,E) 2 1 0 3 4 7 5 6 8 9

  5. A Graph G = (V,E) 2 1 0 3 4 7 5 6 8 9 Colour such that adjacent vertices are different

  6. Model 1

  7. Model 1 kCol Have a constrained integer variable v[i] for each vertex i  V Domain of v[i] is {1..k} the set of avaliable colours For all for all (i,j)  E v[i] ≠ v[j] Decision variable are v[0] to v[n-1] Heuristic, Brelaz

  8. Model 2

  9. Model 2 SAT encoding kCol Consider as an example a 3Col instance with 2 adjacent vertices, i and j boolean variable to represent a vertex x taking a specific colour k “at least one and at most one” constraint adjacent vertices take different colours

  10. Model 2 SAT encoding kCol Heuristics?

  11. Implementation … generate data and pass to minisat+

  12. Model 3

  13. Model 3 Colour Sets of Vertices kCol Have a constrained set variable S[i] for each colour An edge is not in a coloured set All vertices are coloured Decision variables are S[0] to S[k-1] Heuristics? Where col is a set of colours

  14. an example

  15. g10.txt 2 1 0 3 4 7 5 6 8 9

  16. g10.txt 2 1 0 3 4 7 5 6 8 9

  17. g10.txt 2 1 0 3 4 7 5 6 8 9

  18. g10.txt 2 1 0 3 4 7 5 6 1 is red 8 9 2 is green 3 is blue

  19. A different colour with Colour02 g10.txt 2 1 0 3 4 7 5 6 8 9

  20. Generating random graphs

  21. Small demo with data directory

  22. ChromaticNumber

  23. ChromaticNumber

  24. ChromaticNumber We want the minimum number of colours to colour G • introduce a constrained integer variable maxCol • maxCol has domain {1 .. n} • each vertex has a constrained integer variable v[i] • v[i] has domain {1 .. n} • for (int i=0;i<n;i++) modl.addConstraint(leq(v[i],maxCol)) • sol.minimise(maxCol)

  25. ChromaticNumber

  26. ChromaticNumber

  27. ChromaticNumber

  28. MaxCol (min-conflicts) What should we do if there are not enough colours and we want to do the best that we can? That is, colour as many vertices as possible leaving some vertices uncoloured, or colour all vertices and minimise conflicts?

  29. MaxCol (min-conflicts) • associate a dummy colour into domains • dummy colour doesn’t conflict with any other colours • get occurrence of dummy colour and minimise that OR • associate a penalty with a conflict • for edge {i,j} have constrained integer variable P[i][j] • domain P[i][j] is {0,1} • modl.addConstraint(or(and(neq(v[i],v[j]),eq(P[i][j],0)), • (and(eq(v[i],v[j]),eq(P[i][j],1))) • minimise the sum of the penalty variables

More Related