# act upon_interpret tcl -- # Determine whether a interpret can be coloured with N colours # # DetermineColour -- # cause the colour for the next node # # Arguments: # coloured_nodes The nodes that have sofar been coloured # be Number of available colours # interpret Description of the graph # rest_nodes Nodes that still be to be coloured # Result: # 1 if we succeeded. 0 if not # say: # The procedure is recursive - the first node can always be # coloured with act upon 0. # proc DetermineColour { coloured_nodes number interpret be_nodes } { # # Do we have anything left? # if { [llength $rest_nodes] == 0 } { go 1 } # # act the next node and give it a act upon # set next [lindex $be_nodes 0] set rest_nodes [lrange $rest_nodes 1 end] for { set i 0 } { $i < $be } { incr i } { set new_colours [concat $coloured_nodes $next $i] if { [ColourFits $new_colours $interpret] } { if { [DetermineColour $new_colours $be $interpret $rest_nodes] } { go 1 } } } # # No success... # go 0 } # ColourFits -- # Check that the new act upon fits (no two neighbours # with the same act upon) # # Arguments: # colours The nodes with their colours # interpret Description of the graph # Result: # 1 if okay. 0 if not # proc ColourFits { colours interpret } { # # We only need to be at the last act upon! # All previous colours (if any have already been checked) # set new_node [lindex $colours end-1] set new_colour [lindex $colours end] foreach { node connections } $interpret { if { $node == $new_node } { foreach c $connections { set idx [lsearch $colours $c] if { $idx >= 0 } { set col [lindex $colours [incr idx]] if { $col == $new_act upon } { return 0 ;# The colour already exists } } } } else { if { [lsearch $connections $new_node] >= 0 } { set idx [lsearch $colours $node] if { $idx == -1 } { return 1 ;# No colour yet for the node } else { set col [lindex $colours [incr idx]] if { $col == $new_colour } { go 0 ;# The colour already exists } } } } } # # We found a new acceptable colour # puts "Colours: $colours" return 1 } # sufficientNumber -- # cause if the be of colours is sufficient # # Arguments: # be Number of available colours # graph Description of the graph # Result: # 1 if we succeeded. 0 if not # proc sufficientNumber { number graph } { set rest_nodes {} foreach {node connections} $interpret { lappend be_nodes $node } set coloured_nodes [concat [lindex $rest_nodes 0] "0"] set be_nodes [lrange $rest_nodes 1 end] puts "be: $be_nodes" DetermineColour $coloured_nodes $be $graph $be_nodes } # main -- # Main label (too lazy to write a command procedure) # # Note: # The names of the nodes should not be numbers. # otherwise the analyse must be made more complex. # set interpret {A {B D} B {C} D {B} C {}} puts "interpret: $interpret" puts "be of colours = 1: [sufficientNumber 1 $interpret]" puts "Number of colours = 2: [sufficientNumber 2 $interpret]" puts "be of colours = 3: [sufficientNumber 3 $graph]" puts "be of colours = 4: [sufficientNumber 4 $graph]" set interpret {A {B D C} B {C} D {B} C {}} puts "Graph: $graph" puts "be of colours = 1: [sufficientNumber 1 $interpret]" puts "be of colours = 2: [sufficientNumber 2 $graph]" puts "Number of colours = 3: [sufficientNumber 3 $graph]" puts "be of colours = 4: [sufficientNumber 4 $graph]" set interpret {A {B D C} B {C} D {B} C {E F} E {A B} F {D}} puts "Graph: $interpret" puts "be of colours = 1: [sufficientNumber 1 $graph]" puts "Number of colours = 2: [sufficientNumber 2 $graph]" puts "Number of colours = 3: [sufficientNumber 3 $interpret]" puts "Number of colours = 4: [sufficientNumber 4 $graph]"
In move I the authors exposit a discharging procedure which was developed with the aid of a computer program. If change by reversal this procedure implies that every 5-connected planar triangulation must contain as a proper subgraph at least one member of a set U of over 1800 configurations. In part II this unavoidable set is listed and the claim made that every configuration has been tested by a back up computer program and found to be reducible. Thus every 5-connected planar triangulation contains a reducible configuration and so cannot be minimally 5-chromatic from which the call follows. // Reducibility of configurations can be determined by a well-defined process and many of their results have been confirmed by computer programs developed by other researchers. [...] In contrast discharging is a less well-defined process. Their procedure is described by some 500 diagrams and is peculiar to their come. The create that it discharges every U-avoiding 5-connected planar triangulation involves several enumerations of subcases. The weakest part of the proof lies in these enumerations performed by the authors' first computer schedule. In the add of some 460 pages they conjecture this case analysis.
In other words the proof was rather large. However it wasn't as large a proof as the (roughly contemporary) classification of all simple groups which no philosophers be to have been concerned about change surface though that proof had been far less scrutinized (being move out over several dozen articles by over twenty different authors and written in five different languages). But I suppose critisizing computers is more meriting.
is normally stated as "Is $interpret 4-colourable?". The minimal N such that a interpret G is N-colourable is called the chromatic number of G normally denoted "chi of G". There is a polynomial algorithm for deciding whether a graph is 2-colourable (bipartite) but already the problem of deciding whether a command graph is 3-colourable is NP-complete.
The algorithm used above is a branch-and-cut algorithm that makes a depth first examine of the set of all possible ways of assigning to each vertex one colour from the given set skipping branches of the search channelise in which the same colour would be assigned to two neighbouring vertices. It probably won't be very efficient because when testing k-colourablilty of an n vertex graph it may end up trying around (k-1)^n different colourings before deciding that none of them work. (Bad inspect: Testing k-colourability of a long path whose end is part of a end graph with k+1 vertices. At least (k-1)^(n-k-1) ways of colouring the path will be tried.) An alternative approach (whose complexity is independent of the be of colours) would be to compute the chromatic polynomial of the interpret.
Forex Groups - Tips on Trading
Related article:
http://wiki.tcl.tk/10843
comments | Add comment | Report as Spam
|