-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprototype.nb
2824 lines (2765 loc) · 143 KB
/
prototype.nb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 8.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 157, 7]
NotebookDataLength[ 145958, 2815]
NotebookOptionsPosition[ 144049, 2746]
NotebookOutlinePosition[ 144405, 2762]
CellTagsIndexPosition[ 144362, 2759]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Original Uncomplied Version", "Section",
CellChangeTimes->{{3.536384035957593*^9, 3.536384039621282*^9}, {
3.5390663587405643`*^9, 3.539066366153841*^9}}],
Cell[BoxData[
RowBox[{
RowBox[{"Chromatic", "[", "g_", "]"}], ":=",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{",
RowBox[{"c", ",", "f", ",", "h", ",", "min"}], "}"}], ",",
"\[IndentingNewLine]", "\t",
RowBox[{
RowBox[{"c", " ", "=", " ",
RowBox[{"RandomSample", "[",
RowBox[{
RowBox[{"Range", "[", "NumberOfVertices", "]"}], ",",
"NumberOfVertices"}], "]"}]}], ";", "\[IndentingNewLine]", "\t",
RowBox[{"f", " ", "=", " ",
RowBox[{"Function", "[",
RowBox[{
RowBox[{"{",
RowBox[{"c", ",", "v"}], "}"}], ",",
RowBox[{"ReplacePart", "[",
RowBox[{"c", ",",
RowBox[{"v", "\[Rule]",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"ncols", "=",
RowBox[{"c", "\[LeftDoubleBracket]",
RowBox[{
"A", "\[LeftDoubleBracket]", "v", "\[RightDoubleBracket]"}],
"\[RightDoubleBracket]"}]}], "}"}], ",",
RowBox[{
RowBox[{"For", "[",
RowBox[{
RowBox[{"min", "=", "1"}], ",",
RowBox[{"MemberQ", "[",
RowBox[{"ncols", ",", "min"}], "]"}], ",",
RowBox[{"min", "++"}]}], "]"}], ";", "min"}]}], "]"}]}]}],
"]"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\t",
RowBox[{"h", " ", "=", " ",
RowBox[{"Function", "[",
RowBox[{
RowBox[{"{", "c", "}"}], ",",
RowBox[{"Fold", "[",
RowBox[{"f", ",", "c", ",",
RowBox[{"RandomSample", "[",
RowBox[{
RowBox[{"Range", "[", "NumberOfVertices", "]"}], ",",
"NumberOfVertices"}], "]"}]}], "]"}]}], "]"}]}], ";",
"\[IndentingNewLine]", "\t",
RowBox[{"Max", "[",
RowBox[{"FixedPoint", "[",
RowBox[{"h", ",", "c"}], "]"}], "]"}]}]}], "\[IndentingNewLine]",
"]"}]}]], "Code",
CellChangeTimes->{{3.516927847121408*^9, 3.5169278499210243`*^9}, {
3.516927862132934*^9, 3.5169278947725*^9}, 3.5360895361330023`*^9, {
3.536091326192409*^9, 3.5360913328856077`*^9}, {3.536091643368154*^9,
3.536091649899578*^9}}],
Cell[BoxData[{
RowBox[{
RowBox[{"NumberOfVertices", "=", "500"}], ";"}], "\n",
RowBox[{
RowBox[{"g", " ", "=", " ",
RowBox[{
RowBox[{"RandomGraph", "[",
RowBox[{
RowBox[{"BernoulliGraphDistribution", "[",
RowBox[{"NumberOfVertices", ",", "0.8"}], "]"}], ",", " ", "1"}],
"]"}], "[",
RowBox[{"[", "1", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"A", " ", "=", " ",
RowBox[{"Last", " ", "/@", " ",
RowBox[{"Transpose", " ", "/@", " ",
RowBox[{"GatherBy", "[",
RowBox[{
RowBox[{"First", " ", "/@", " ",
RowBox[{"Most", "[",
RowBox[{"ArrayRules", "[",
RowBox[{"AdjacencyMatrix", "[", "g", "]"}], "]"}], "]"}]}], ",",
" ", "First"}], "]"}]}]}]}], ";"}]}], "Code",
CellChangeTimes->{{3.516916885547307*^9, 3.516916908265835*^9}, {
3.5169206869563007`*^9, 3.516920687865275*^9}, {3.516920706982955*^9,
3.51692070867767*^9}, {3.516922840001772*^9, 3.516922842727453*^9},
3.516923523567252*^9, {3.516923943445023*^9, 3.516923943949779*^9}, {
3.516930105127928*^9, 3.516930105681007*^9}, 3.5169303228476763`*^9,
3.529163626425061*^9, {3.529163881568521*^9, 3.5291638821900253`*^9}, {
3.5291641770160503`*^9, 3.5291641771828413`*^9}, {3.5291663834914217`*^9,
3.529166383609198*^9}, {3.53609165836747*^9, 3.536091676624783*^9},
3.53638576324678*^9, 3.536385797921664*^9, {3.536389041532422*^9,
3.53638904242677*^9}, 3.536389184967087*^9, {3.536390650077202*^9,
3.5363906502530813`*^9}, 3.536392388605459*^9, {3.536397349379682*^9,
3.536397349906281*^9}, {3.536398240654468*^9, 3.536398249558302*^9}, {
3.5364006485894527`*^9, 3.53640064892356*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell["Complied Version", "Section",
CellChangeTimes->{{3.5363840670311213`*^9, 3.536384068836379*^9}, {
3.5363849913394117`*^9, 3.536384992723139*^9}, {3.5390663684627247`*^9,
3.539066370968445*^9}}],
Cell["This code is about 4 - times faster.", "Text",
CellChangeTimes->{{3.536383622908147*^9, 3.5363836327774563`*^9}, {
3.5363866793235292`*^9, 3.53638668288308*^9}}],
Cell["\<\
1. Instead of a List A, we generate a collection of down value rules for \
symbol VertexNeighborhood. \
VertexNeighborhood[1]\[Equal]A[[1]],VertexNeighborhood[2]\[Equal]A[2],\
\[Ellipsis]
Note, that VertexNeighborhood renders {}, if no connecting edge is found. \
List A can only handle connected graphs.
Furthermore,VertexNeighborhood[k] can be used in compiled code,whereas A[[k]] \
cannot since A is not a matrix.\
\>", "Text",
CellChangeTimes->{{3.536383622908147*^9, 3.5363836521993713`*^9}, {
3.5363836962245483`*^9, 3.536383696447747*^9}, {3.536386689427123*^9,
3.5363867075631313`*^9}, {3.5363973988550577`*^9, 3.536397399057872*^9}}],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"CreateVertexNeighborhoods", "[", "g_", "]"}], " ", ":=", " ",
RowBox[{"Module", "[", "\n", "\t",
RowBox[{
RowBox[{"{",
RowBox[{
"vertices", ",", " ", "edges", ",", " ", "rules1", ",", " ", "rules2"}],
"}"}], ",", "\n", "\t",
RowBox[{
RowBox[{"vertices", " ", "=", " ",
RowBox[{"VertexList", "[", "g", "]"}]}], ";", " ", "\n", "\t",
RowBox[{"edges", " ", "=", " ",
RowBox[{"EdgeRules", "[", "g", "]"}]}], ";", "\n", "\t",
RowBox[{"rules1", " ", "=", " ",
RowBox[{"Dispatch", " ", "@", " ",
RowBox[{"Append", "[",
RowBox[{
RowBox[{"Map", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"#", "\[LeftDoubleBracket]",
RowBox[{"1", ",", " ", "1"}], "\[RightDoubleBracket]"}], " ",
"\[Rule]", " ",
RowBox[{"#", "\[LeftDoubleBracket]",
RowBox[{"All", ",", " ", "2"}], "\[RightDoubleBracket]"}]}],
")"}], "&"}], ",", " ",
RowBox[{"GatherBy", "[",
RowBox[{"edges", ",", " ", "First"}], "]"}]}], "]"}], ",", " ",
RowBox[{"_", " ", "\[Rule]", " ",
RowBox[{"{", "}"}]}]}], "]"}]}]}], ";", "\[IndentingNewLine]",
"\t",
RowBox[{"rules2", " ", "=", " ",
RowBox[{"Dispatch", " ", "@", " ",
RowBox[{"Append", "[",
RowBox[{
RowBox[{"Map", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"#", "\[LeftDoubleBracket]",
RowBox[{"1", ",", " ", "2"}], "\[RightDoubleBracket]"}], " ",
"\[Rule]", " ",
RowBox[{"#", "\[LeftDoubleBracket]",
RowBox[{"All", ",", " ", "1"}], "\[RightDoubleBracket]"}]}],
")"}], "&"}], ",", " ",
RowBox[{"GatherBy", "[",
RowBox[{"edges", ",", " ", "Last"}], "]"}]}], "]"}], ",", " ",
RowBox[{"_", " ", "\[Rule]", " ",
RowBox[{"{", "}"}]}]}], "]"}]}]}], ";", "\[IndentingNewLine]",
"\t",
RowBox[{"Clear", "[", "VertexNeighborhood", "]"}], ";", "\n", "\t",
RowBox[{"MapThread", "[", "\n", "\t\t",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"VertexNeighborhood", "[", "#1", "]"}], " ", "=", " ",
RowBox[{"Join", "[",
RowBox[{"#2", ",", " ", "#3"}], "]"}]}], ")"}], "&"}], ",", "\n",
"\t\t",
RowBox[{"{",
RowBox[{"vertices", ",", " ",
RowBox[{"Replace", "[",
RowBox[{"vertices", ",", " ", "rules2", ",", " ",
RowBox[{"{", "1", "}"}]}], "]"}], ",", " ",
RowBox[{"Replace", "[",
RowBox[{"vertices", ",", " ", "rules1", ",", " ",
RowBox[{"{", "1", "}"}]}], "]"}]}], "}"}]}], "\n", "\n", "\t",
"]"}], ";"}]}], "\n", "]"}]}], ";"}], "\n",
RowBox[{"CreateVertexNeighborhoods", "[", "g", "]"}]}], "Code",
CellChangeTimes->{{3.536383622908147*^9, 3.536383650176022*^9}, {
3.536383695063446*^9, 3.5363837363492117`*^9}, {3.5363849051489067`*^9,
3.536384907131226*^9}, {3.536384957725285*^9, 3.536385103187435*^9}, {
3.536386513432427*^9, 3.536386528106543*^9}, {3.5363891115147552`*^9,
3.536389155456325*^9}}],
Cell["\<\
2. Compiled function ChromaticNumberLowerBoundIteration[a, b] is equivalent \
to Fold[f, a, b].\
\>", "Text",
CellChangeTimes->{{3.536383622908147*^9, 3.536383650176022*^9}, {
3.536383695063446*^9, 3.536383747301896*^9}}],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{
RowBox[{"Clear", "[", "ChromaticNumberLowerBoundIteration", "]"}],
";"}], "\n",
RowBox[{"ChromaticNumberLowerBoundIteration", " ", "=", " ",
RowBox[{"Compile", "[", "\n", "\t",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"c", ",", " ", "_Integer", ",", " ", "1"}], "}"}], ",", " ",
RowBox[{"{",
RowBox[{"vs", ",", " ", "_Integer", ",", " ", "1"}], "}"}]}], "}"}],
",", "\n", "\t",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"cc", " ", "=", " ", "c"}], ",", "v", ",", "ncols", ",", "k",
",", "j"}], "}"}], ",", "\[IndentingNewLine]", "\t\t",
RowBox[{
RowBox[{"Do", "[",
RowBox[{
RowBox[{
RowBox[{"v", " ", "=", " ",
RowBox[{"vs", "[",
RowBox[{"[", "j", "]"}], "]"}]}], ";", "\[IndentingNewLine]",
"\t\t",
RowBox[{"ncols", " ", "=", " ",
RowBox[{"cc", "[",
RowBox[{"[",
RowBox[{"VertexNeighborhood", "[", "v", "]"}], "]"}], "]"}]}],
";", "\[IndentingNewLine]", "\t\t",
RowBox[{"k", " ", "=", " ", "1"}], ";", "\[IndentingNewLine]",
"\t\t",
RowBox[{"While", "[",
RowBox[{
RowBox[{"MemberQ", "[",
RowBox[{"ncols", ",", " ", "k"}], "]"}], ",", " ",
RowBox[{"k", "++"}]}], "]"}], ";", "\[IndentingNewLine]", "\t\t",
RowBox[{
RowBox[{"cc", "[",
RowBox[{"[", "v", "]"}], "]"}], " ", "=", " ", "k"}]}], ",", " ",
RowBox[{"{",
RowBox[{"j", ",", " ",
RowBox[{"Length", "[", "vs", "]"}]}], "}"}]}], "]"}], ";",
"\[IndentingNewLine]", "\t\t",
RowBox[{"Return", "[", "cc", "]"}]}]}], "\n", "\t", "]"}], ",", "\n",
"\t",
RowBox[{"{",
RowBox[{"{",
RowBox[{
RowBox[{"VertexNeighborhood", "[", "_", "]"}], ",", " ", "_Integer",
",", " ", "1"}], "}"}], "}"}], ",", "\n", "\t",
RowBox[{"CompilationTarget", " ", "\[Rule]", " ", "\"\<C\>\""}], ",",
"\n", "\t",
RowBox[{"RuntimeOptions", " ", "\[Rule]", " ", "\"\<Speed\>\""}], ",",
"\n", "\t",
RowBox[{"RuntimeAttributes", " ", "\[Rule]", " ",
RowBox[{"{", "Listable", "}"}]}], ",", "\n", "\t",
RowBox[{"Parallelization", " ", "\[Rule]", " ", "True"}]}], "\n",
"]"}]}]}], "Code",
CellChangeTimes->{{3.536383622908147*^9, 3.536383650176022*^9}, {
3.536383695063446*^9, 3.5363837414932756`*^9}, {3.5363838654426413`*^9,
3.536383868729266*^9}, {3.536385107898444*^9, 3.5363851943516207`*^9}, {
3.536386111614058*^9, 3.536386132670168*^9}, {3.536386162893032*^9,
3.536386268361137*^9}, {3.536386379862499*^9, 3.536386381436721*^9}, {
3.536386413587348*^9, 3.536386419003819*^9}, {3.536386471358368*^9,
3.5363864748360167`*^9}, {3.536386777021199*^9, 3.536386778473422*^9}, {
3.5363868277360563`*^9, 3.53638682839192*^9}, {3.536388917682851*^9,
3.536388920103568*^9}, {3.536388981143428*^9, 3.53638901944587*^9}}],
Cell[BoxData[
TagBox[
RowBox[{"CompiledFunction", "[",
RowBox[{
RowBox[{"{",
RowBox[{"c", ",", "vs"}], "}"}], ",",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"cc", "=", "c"}], ",", "v", ",", "ncols", ",", "k", ",",
"j"}], "}"}], ",",
RowBox[{
RowBox[{"Do", "[",
RowBox[{
RowBox[{
RowBox[{"v", "=",
RowBox[{
"vs", "\[LeftDoubleBracket]", "j", "\[RightDoubleBracket]"}]}],
";",
RowBox[{"ncols", "=",
RowBox[{"cc", "\[LeftDoubleBracket]",
RowBox[{"VertexNeighborhood", "[", "v", "]"}],
"\[RightDoubleBracket]"}]}], ";",
RowBox[{"k", "=", "1"}], ";",
RowBox[{"While", "[",
RowBox[{
RowBox[{"MemberQ", "[",
RowBox[{"ncols", ",", "k"}], "]"}], ",",
RowBox[{"k", "++"}]}], "]"}], ";",
RowBox[{
RowBox[{
"cc", "\[LeftDoubleBracket]", "v", "\[RightDoubleBracket]"}], "=",
"k"}]}], ",",
RowBox[{"{",
RowBox[{"j", ",",
RowBox[{"Length", "[", "vs", "]"}]}], "}"}]}], "]"}], ";",
RowBox[{"Return", "[", "cc", "]"}]}]}], "]"}],
",", "\<\"-CompiledCode-\"\>"}], "]"}],
False,
Editable->False]], "Output",
CellChangeTimes->{3.5363867796710587`*^9, 3.536386830936565*^9,
3.5363889251116047`*^9, 3.536389026974246*^9, 3.5363906564735518`*^9,
3.5363923939551783`*^9, 3.536397970531804*^9, 3.536398395378284*^9,
3.536400657560557*^9}]
}, Open ]],
Cell["3. Wrapping it all into one command.", "Text",
CellChangeTimes->{{3.536383622908147*^9, 3.536383650176022*^9}, {
3.536383695063446*^9, 3.536383744021351*^9}}],
Cell[BoxData[{
RowBox[{
RowBox[{"Clear", "[", "ChromaticNumberLowerBound", "]"}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{"Options", "[", "ChromaticNumberLowerBound", "]"}], " ", "=", " ",
RowBox[{"{",
RowBox[{"\"\<Max\>\"", " ", "\[Rule]", " ", "True"}], "}"}]}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"ChromaticNumberLowerBound", "[",
RowBox[{"g_Graph", ",", " ",
RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], " ", ":=", " ",
RowBox[{"Module", "[", "\n", "\t",
RowBox[{
RowBox[{"{",
RowBox[{"vertices", " ", "=", " ",
RowBox[{"VertexList", "[", "g", "]"}]}], "}"}], ",", "\n", "\t",
RowBox[{
RowBox[{"CreateVertexNeighborhoods", "[", "g", "]"}], ";", "\n", "\t",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<Max\>\"", "]"}], ",", " ", "Max",
",", " ", "Identity"}], "]"}], "[", "\n", "\t\t",
RowBox[{"FixedPoint", "[",
RowBox[{
RowBox[{
RowBox[{"ChromaticNumberLowerBoundIteration", "[",
RowBox[{"#", ",", " ",
RowBox[{"RandomSample", "[", "vertices", "]"}]}], "]"}], "&"}],
",", " ",
RowBox[{"RandomSample", "[", "vertices", "]"}]}], "]"}], "\n", "\t",
"]"}]}]}], "\n", "]"}]}], ";"}], "\[IndentingNewLine]"}], "\n",
RowBox[{
RowBox[{
RowBox[{"ChromaticNumberLowerBound", "[",
RowBox[{"g_Graph", ",", " ", "colorVector_", ",", " ",
RowBox[{"OptionsPattern", "[", "]"}]}], "]"}], " ", ":=", " ",
RowBox[{"Module", "[", "\n", "\t",
RowBox[{
RowBox[{"{",
RowBox[{"vertices", " ", "=", " ",
RowBox[{"VertexList", "[", "g", "]"}]}], "}"}], ",", "\n", "\t",
RowBox[{
RowBox[{"CreateVertexNeighborhoods", "[", "g", "]"}], ";", "\n", "\t",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{"OptionValue", "[", "\"\<Max\>\"", "]"}], ",", " ", "Max",
",", " ", "Identity"}], "]"}], "[", "\n", "\t\t",
RowBox[{"FixedPoint", "[",
RowBox[{
RowBox[{
RowBox[{"ChromaticNumberLowerBoundIteration", "[",
RowBox[{"#", ",", " ",
RowBox[{"RandomSample", "[", "vertices", "]"}]}], "]"}], "&"}],
",", " ", "colorVector"}], "]"}], "\n", "\t", "]"}]}]}], "\n",
"]"}]}], ";"}]}], "Code",
CellChangeTimes->{{3.536383622908147*^9, 3.536383650176022*^9}, {
3.536383695063446*^9, 3.536383717662471*^9}, {3.5363838783266773`*^9,
3.536383883502976*^9}, {3.5363844582455873`*^9, 3.53638448077778*^9}, {
3.536384842338511*^9, 3.5363849447720547`*^9}, {3.536385201231789*^9,
3.536385342022505*^9}, {3.536385583790244*^9, 3.5363855999437838`*^9}, {
3.536386641527033*^9, 3.53638664352892*^9}}],
Cell[CellGroupData[{
Cell["Example", "Subsection",
CellChangeTimes->{{3.536383887702229*^9, 3.536383890092005*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Through", "[",
RowBox[{
RowBox[{"{",
RowBox[{"VertexCount", ",", "EdgeCount"}], "}"}], "[", "g", "]"}],
"]"}]], "Input",
CellChangeTimes->{
3.536383982438302*^9, {3.536385819205399*^9, 3.536385843885083*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"500", ",", "99997"}], "}"}]], "Output",
CellChangeTimes->{
3.536385847762429*^9, 3.5363862851650743`*^9, 3.5363864365236893`*^9, {
3.5363890378945427`*^9, 3.536389050378294*^9}, 3.536392396212688*^9,
3.536397971178784*^9, 3.5363983960959253`*^9, 3.536400660063347*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"res", "=",
RowBox[{
RowBox[{"Sort", "@",
RowBox[{"Tally", "@",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"Chromatic", "[", "g", "]"}], ",",
RowBox[{"{", "10", "}"}]}], "]"}]}]}], "//",
"AbsoluteTiming"}]}]], "Input",
CellChangeTimes->{{3.536385449022676*^9, 3.536385449396299*^9}, {
3.536385856177259*^9, 3.5363858564962187`*^9}, {3.536386870572188*^9,
3.536386874210051*^9}, 3.536386916672217*^9, {3.536389057234766*^9,
3.536389058497312*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"19.092714`7.732412660572008", ",",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"135", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"136", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"137", ",", "2"}], "}"}], ",",
RowBox[{"{",
RowBox[{"139", ",", "2"}], "}"}]}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{
3.53638400792073*^9, {3.536384081908784*^9, 3.536384105145206*^9},
3.5363841444399014`*^9, {3.536385445348014*^9, 3.536385462304709*^9},
3.5363858745400553`*^9, 3.536386101110319*^9, 3.536386302950145*^9,
3.53638645472721*^9, {3.5363869244724007`*^9, 3.53638695084166*^9},
3.536389195111189*^9, 3.536392410669157*^9, 3.53639823770555*^9,
3.536400645098987*^9, 3.536400680146986*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"res", "=",
RowBox[{
RowBox[{"Sort", "@",
RowBox[{"Tally", "@",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"ChromaticNumberLowerBound", "[", "g", "]"}], ",",
RowBox[{"{", "10", "}"}]}], "]"}]}]}], "//",
"AbsoluteTiming"}]}]], "Input",
CellChangeTimes->{
3.5363839998094587`*^9, {3.5363854515807323`*^9, 3.5363854530921803`*^9}, {
3.536385863615559*^9, 3.536385863784581*^9}, {3.5363868032260637`*^9,
3.536386804323563*^9}, {3.5363868385325317`*^9, 3.536386884385427*^9},
3.536389062953476*^9}],
Cell[BoxData[
RowBox[{"{",
RowBox[{"2.305919`6.814389041263469", ",",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"133", ",", "1"}], "}"}], ",",
RowBox[{"{",
RowBox[{"135", ",", "4"}], "}"}], ",",
RowBox[{"{",
RowBox[{"136", ",", "1"}], "}"}], ",",
RowBox[{"{",
RowBox[{"137", ",", "3"}], "}"}], ",",
RowBox[{"{",
RowBox[{"140", ",", "1"}], "}"}]}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{{3.53638688708539*^9, 3.536386901077489*^9},
3.536389075006392*^9, 3.536392412328526*^9, 3.536400682629014*^9}]
}, Open ]]
}, Open ]]
}, Open ]],
Cell[CellGroupData[{
Cell["Genetic Algrithm v1", "Section",
CellChangeTimes->{{3.536384128676824*^9, 3.53638413101924*^9}, {
3.5363842551685266`*^9, 3.5363842559524717`*^9}, {3.536397254734621*^9,
3.536397256470819*^9}, {3.539066375743887*^9, 3.539066382600068*^9}}],
Cell[BoxData[{
RowBox[{
RowBox[{"Chromatize", "[", "colorVector_", "]"}], " ", ":=", " ",
RowBox[{"ChromaticNumberLowerBound", "[",
RowBox[{"g", ",", " ", "colorVector", ",", " ",
RowBox[{"\"\<Max\>\"", " ", "\[Rule]", " ", "False"}]}], "]"}]}], "\n",
RowBox[{
RowBox[{"Combine", "[",
RowBox[{"c1_", ",", " ", "c2_"}], "]"}], " ", ":=", " ",
RowBox[{"{",
RowBox[{
RowBox[{"MapThread", "[",
RowBox[{
RowBox[{
RowBox[{"RandomChoice", "[",
RowBox[{"{",
RowBox[{"#1", ",", " ", "#2"}], "}"}], "]"}], "&"}], ",", " ",
RowBox[{"{",
RowBox[{"c1", ",", " ", "c2"}], "}"}]}], "]"}], ",", " ",
RowBox[{"MapThread", "[",
RowBox[{
RowBox[{
RowBox[{"RandomChoice", "[",
RowBox[{"{",
RowBox[{"#1", ",", " ", "#2"}], "}"}], "]"}], "&"}], ",", " ",
RowBox[{"{",
RowBox[{"c1", ",", " ", "c2"}], "}"}]}], "]"}]}], "}"}]}], "\n",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"Mutate", "[", "c_", "]"}], " ", ":=", " ",
RowBox[{"MapAt", "[",
RowBox[{
RowBox[{
RowBox[{"#", "+", "10"}], "&"}], ",", " ", "c", ",", " ",
RowBox[{"RandomInteger", "[",
RowBox[{"{",
RowBox[{"1", ",", " ",
RowBox[{"Length", "[", "c", "]"}]}], "}"}], "]"}]}], "]"}]}], ";"}],
"\n"}], "\n",
RowBox[{
RowBox[{"Clear", "[", "InitialPopulation", "]"}], ";"}], "\n",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"InitialPopulation", "[", "p_", "]"}], " ", ":=", " ",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"Chromatize", "[",
RowBox[{"RandomSample", "[",
RowBox[{"Range", "[", "NumberOfVertices", "]"}], "]"}], "]"}], ",",
" ",
RowBox[{"{", "p", "}"}]}], "]"}]}], ";"}], "\n", "\t"}], "\n",
RowBox[{
RowBox[{
RowBox[{"Clear", "[", "PopulationStep", "]"}], ";"}], "\n",
RowBox[{"(*", "\n",
RowBox[{
RowBox[{"PopulationStep", "[", "population_", "]"}], " ", ":=", " ",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{",
RowBox[{
"sortedPopulation", ",", " ", "breeders", ",", " ", "best", ",", " ",
"children"}], "}"}], ",", "\n", "\t",
RowBox[{
RowBox[{"sortedPopulation", " ", "=", " ",
RowBox[{
RowBox[{
RowBox[{"SortBy", "[",
RowBox[{"population", ",", " ", "Max"}], "]"}], "\n", "\t",
"best"}], " ", "=", " ",
RowBox[{"Take", "[",
RowBox[{"sortedPopulation", ",", " ", "NumberOfBest"}], "]"}]}]}],
";", "\n", "\t",
RowBox[{"breeders", " ", "=", " ",
RowBox[{"Take", "[",
RowBox[{"sortedPopulation", ",", " ", "NumberOfBreeders"}], "]"}]}],
";", "\n", "\t",
RowBox[{"children", " ", "=", " ",
RowBox[{"Chromatize", " ", "/@", " ",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"Combine", " ", "@@", " ",
RowBox[{"RandomChoice", "[",
RowBox[{"breeders", ",", " ", "2"}], "]"}]}], ",", " ",
RowBox[{"{",
RowBox[{"PopulationSize", "-", "NumberOfBest"}], "}"}]}],
"]"}]}]}], ";", "\[IndentingNewLine]", "\t",
RowBox[{"Join", "[",
RowBox[{"best", ",", "children"}], "]"}]}]}], "\[IndentingNewLine]",
"]"}]}], "*)"}], "\n", "\n",
RowBox[{"(*",
RowBox[{
RowBox[{"PopulationStep", "[",
RowBox[{
"population_", ",", " ", "NumberOfBest_", ",", " ",
"NumberOfBreeders_"}], "]"}], " ", ":=", " ",
RowBox[{"Module", "[",
RowBox[{
RowBox[{"{",
RowBox[{
"sortedPopulation", ",", " ", "breeders", ",", " ", "best", ",", " ",
"children"}], "}"}], ",", "\n", "\t",
RowBox[{
RowBox[{"sortedPopulation", " ", "=", " ",
RowBox[{"SortBy", "[",
RowBox[{"population", ",", " ", "Max"}], "]"}]}], ";", "\n", "\t",
RowBox[{"best", " ", "=", " ",
RowBox[{"Take", "[",
RowBox[{"sortedPopulation", ",", " ", "NumberOfBest"}], "]"}]}], ";",
"\n", "\t",
RowBox[{"breeders", " ", "=", " ",
RowBox[{"Take", "[",
RowBox[{"sortedPopulation", ",", " ", "NumberOfBreeders"}], "]"}]}],
";", "\n", "\t",
RowBox[{"children", " ", "=", " ",
RowBox[{"Chromatize", " ", "/@", " ",
RowBox[{"ParallelTable", "[",
RowBox[{
RowBox[{"Combine", " ", "@@", " ",
RowBox[{"RandomChoice", "[",
RowBox[{"breeders", ",", " ", "2"}], "]"}]}], ",", " ",
RowBox[{"{",
RowBox[{"PopulationSize", "-", "NumberOfBest"}], "}"}]}],
"]"}]}]}], ";", "\[IndentingNewLine]", "\t",
RowBox[{"Join", "[",
RowBox[{"best", ",", "children"}], "]"}]}]}], "\[IndentingNewLine]",
"]"}]}], "*)"}], "\n", "\n"}], "\n",
RowBox[{
RowBox[{"PopulationStep", "[",
RowBox[{"population_", ",", " ", "p_", ",", " ", "r_", ",", " ", "m_"}],
"]"}], " ", ":=", " ",
RowBox[{"Module", "[", "\n", "\t",
RowBox[{
RowBox[{"{",
RowBox[{
"fitness", ",", " ", "weights", ",", " ", "nextGeneration", ",", " ",
RowBox[{"s", " ", "=",
RowBox[{"Round", "[",
RowBox[{
RowBox[{"(",
RowBox[{"1", "-", "r"}], ")"}], "*", "p"}], "]"}]}], ",", "t"}],
"}"}], ",", "\n", "\n", "\t",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{"OddQ", "[",
RowBox[{"p", "-", "s"}], "]"}], ",",
RowBox[{"s", "++"}]}], "]"}], ";", "\n", "\n", "\t",
RowBox[{"t", " ", "=", " ",
RowBox[{"p", "-", "s"}]}], ";", "\n", "\t", "\n", "\t",
RowBox[{"fitness", " ", "=", " ",
RowBox[{"1", "/",
RowBox[{"(",
RowBox[{"Max", " ", "/@", " ", "population"}], ")"}]}]}], ";", "\n",
"\t", "\n", "\t",
RowBox[{"weights", " ", "=", " ",
RowBox[{"N", "[",
RowBox[{"fitness", "/",
RowBox[{"(",
RowBox[{"Plus", " ", "@@", " ", "fitness"}], ")"}]}], "]"}]}], ";",
"\n", "\n", "\t",
RowBox[{"nextGeneration", " ", "=", " ",
RowBox[{"RandomChoice", "[",
RowBox[{
RowBox[{"weights", " ", "\[Rule]", " ", "population"}], ",", " ",
"s"}], "]"}]}], ";", "\n", "\n", "\t",
RowBox[{"nextGeneration", " ", "=", " ",
RowBox[{"Join", "[",
RowBox[{"nextGeneration", ",", " ",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"Sequence", " ", "@@", " ", "#"}], ")"}], "&"}], " ", "/@",
" ",
RowBox[{"Combine", " ", "@@@", " ",
RowBox[{"Partition", "[",
RowBox[{
RowBox[{"RandomChoice", "[",
RowBox[{
RowBox[{"weights", " ", "\[Rule]", " ", "population"}], ",",
" ", "t"}], "]"}], ",", " ", "2"}], "]"}]}]}]}], "]"}]}], ";",
"\n", "\n", "\t",
RowBox[{"nextGeneration", " ", "=", " ",
RowBox[{"MapAt", "[",
RowBox[{"Mutate", ",", " ", "nextGeneration", ",", " ",
RowBox[{"Thread", "[",
RowBox[{"{",
RowBox[{"RandomChoice", "[",
RowBox[{
RowBox[{"Range", "[", "p", "]"}], ",", " ",
RowBox[{"Floor", "[",
RowBox[{"m", "*", "p"}], "]"}]}], "]"}], "}"}], "]"}]}], "]"}]}],
";", "\n", "\t", "\n", "\t",
RowBox[{"nextGeneration", " ", "=", " ",
RowBox[{"Chromatize", " ", "/@", " ", "nextGeneration"}]}], ";", "\n",
"\t", "\n", "\t", "nextGeneration"}]}], "\[IndentingNewLine]",
"]"}]}]}], "Code",
CellChangeTimes->{{3.51691594059347*^9, 3.516915942233238*^9}, {
3.5169163778372498`*^9, 3.516916380675156*^9}, 3.516916584557843*^9, {
3.5169166612477827`*^9, 3.516916670531684*^9}, {3.516916728267033*^9,
3.5169167481681004`*^9}, {3.5169167609095097`*^9,
3.5169167610457907`*^9}, {3.516916798968253*^9, 3.5169168272432756`*^9}, {
3.516916839465424*^9, 3.516916841631544*^9}, {3.516916852936775*^9,
3.5169168615497*^9}, 3.516916892648818*^9, 3.5169169107254*^9, {
3.5169170580839157`*^9, 3.516917058226697*^9}, {3.516922849924344*^9,
3.5169228511227207`*^9}, {3.5169235324817553`*^9, 3.516923538144953*^9}, {
3.5363842219827957`*^9, 3.536384224391033*^9}, {3.53638439546128*^9,
3.536384440292976*^9}, {3.53638451085635*^9, 3.536384750175194*^9}, {
3.5363848165441647`*^9, 3.5363848307918653`*^9}, {3.536385375530147*^9,
3.5363854015769157`*^9}, {3.536385482097279*^9, 3.536385493257388*^9}, {
3.536385673061359*^9, 3.536385675357531*^9}, {3.536387093967163*^9,
3.53638712541154*^9}, 3.536387341730884*^9, {3.536387468580913*^9,
3.536387505700625*^9}, 3.536387551731772*^9, {3.5363881244038963`*^9,
3.536388141329947*^9}, {3.536389546318321*^9, 3.536390046362734*^9}, {
3.53639007977216*^9, 3.536390156558827*^9}, {3.5363902063904047`*^9,
3.536390426982085*^9}, {3.5363904652416563`*^9, 3.536390512162355*^9}, {
3.5363905575811453`*^9, 3.5363906288650513`*^9}, {3.536390676656094*^9,
3.5363906804390783`*^9}, {3.5363907905508547`*^9, 3.536390805180662*^9}, {
3.536390838453912*^9, 3.536390842107334*^9}, {3.5363909061639957`*^9,
3.536390931712555*^9}, {3.5363911547757998`*^9, 3.536391167435244*^9}, {
3.536391388982431*^9, 3.5363913905639668`*^9}, {3.536391422485915*^9,
3.536391425480693*^9}, {3.536391472497014*^9, 3.536391477532639*^9}, {
3.536391511952808*^9, 3.536391516758103*^9}, {3.5363916305791883`*^9,
3.536391655487692*^9}, {3.5363917630701847`*^9, 3.536391780485526*^9}, {
3.536391831030732*^9, 3.536391836150076*^9}, {3.53639188806523*^9,
3.536391904977626*^9}, {3.536392039412531*^9, 3.53639204873293*^9}, {
3.5363921279001293`*^9, 3.536392128674087*^9}, {3.536392201463291*^9,
3.536392205971455*^9}, {3.536392268267501*^9, 3.536392309877709*^9}, {
3.536392485668363*^9, 3.5363925647916603`*^9}, {3.536393044326097*^9,
3.5363930541923*^9}, {3.5363931069072933`*^9, 3.536393190409693*^9}, {
3.536393230416526*^9, 3.536393254121154*^9}, {3.536393352773119*^9,
3.5363933828355227`*^9}, {3.536393476049478*^9, 3.5363934837817717`*^9},
3.5363935870659027`*^9, {3.536393633781825*^9, 3.536393649483513*^9}, {
3.536393739048811*^9, 3.5363937727741613`*^9}, {3.536393861558807*^9,
3.536393870476205*^9}, {3.5363939144868393`*^9, 3.536393930756419*^9}, {
3.5363939813147573`*^9, 3.536393996547323*^9}, {3.5363940758893127`*^9,
3.536394122207945*^9}, {3.53639416494353*^9, 3.5363941826425734`*^9}, {
3.536394302192247*^9, 3.536394318023831*^9}, {3.5363943581340113`*^9,
3.5363944063035593`*^9}, {3.536394451232808*^9, 3.536394517841827*^9}, {
3.53639455577246*^9, 3.536394560327216*^9}, {3.536394666489287*^9,
3.5363947088728523`*^9}, {3.536394752258438*^9, 3.536394796789756*^9}, {
3.536394853498653*^9, 3.5363949002620687`*^9}, {3.536394941514567*^9,
3.536394965587125*^9}, {3.536395008168844*^9, 3.5363950735318336`*^9}, {
3.536395130939681*^9, 3.536395131269809*^9}, {3.536395172002887*^9,
3.536395180742153*^9}, {3.536395218496347*^9, 3.5363952187256413`*^9}, {
3.5363952613929358`*^9, 3.536395291779089*^9}, {3.536395568411606*^9,
3.5363955700202427`*^9}, {3.536395600119875*^9, 3.536395644523189*^9}, {
3.536395721576968*^9, 3.536395746415084*^9}, {3.536396175799313*^9,
3.536396187879928*^9}, 3.536396311696764*^9, {3.5363965500625353`*^9,
3.536396552908012*^9}, {3.5363966129242*^9, 3.536396619562058*^9}, {
3.5363966657879133`*^9, 3.5363966702743177`*^9}, {3.536396771827571*^9,
3.536396782885467*^9}, {3.536397068999236*^9, 3.536397071766659*^9},
3.536397211499302*^9}],
Cell[BoxData[{
RowBox[{
RowBox[{
RowBox[{"r", "=", " ", "1"}], ";"}], " ",
RowBox[{"(*", " ",
RowBox[{"fraction", " ", "replaced", " ", "by", " ", "crossover"}], " ",
"*)"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"m", " ", "=", " ", "0"}], ";", " ",
RowBox[{"(*", " ",
RowBox[{"mutation", " ", "rate"}], " ", "*)"}], "\[IndentingNewLine]",
RowBox[{"p", " ", "=", " ", "50"}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"n", " ", "=", " ", "10"}], ";"}], "\n",
RowBox[{
RowBox[{"gens", "=",
RowBox[{"NestList", "[",
RowBox[{
RowBox[{
RowBox[{"PopulationStep", "[",
RowBox[{"#", ",", "p", ",", "r", ",", "m"}], "]"}], "&"}], ",",
RowBox[{"InitialPopulation", "[", "p", "]"}], ",", "n"}], "]"}]}],
";"}]}], "Input",
CellChangeTimes->{{3.5363932691153173`*^9, 3.536393292280293*^9}, {
3.536393697513013*^9, 3.536393697649016*^9}, {3.536393812623459*^9,
3.536393818708199*^9}, 3.536394018933116*^9, 3.536395095340063*^9, {
3.536396583135741*^9, 3.5363965947672462`*^9}, {3.53639672031047*^9,
3.536396752142169*^9}, {3.536396860089625*^9, 3.5363968728842707`*^9}, {
3.536397119697987*^9, 3.536397128243471*^9}, {3.536397158310412*^9,
3.536397158668339*^9}, {3.536397221230752*^9, 3.536397221590996*^9}}],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"ArrayPlot", "/@", "gens"}]], "Input",
CellChangeTimes->{{3.536395103733708*^9, 3.5363951098970757`*^9}}],
Cell[BoxData[
RowBox[{"{",
RowBox[{
GraphicsBox[RasterBox[CompressedData["
1:eJwdlze27LCSZX/dpBYgtNbS76H0EGq13/P3Cq+MdJMkELHPPum//////e+/
//znP/9n/v7f/IEOx5W9MEM9hiFa3ofcKY+ys/PMDwb7OvqOY3Y0GdfIzXW0
vJaP2aO26L8gOWUIWll7UDfWobbDKUGCkMmv6TUbFX0hcv4PKltoDtmsm7IH
LeBikFEP3+/R3fQ0qrnmnxaRNvY+Euwvvm0bTsUv3/h03EtDMgk8yoFr4Keg
MXurNILgu/YKEo6vbhczLzUnpwcPX0JgQa3sar16DgkG1+/iB92I36qFUSxc
tv5gMbQhzJVwUn/DLfeBH5aldkj5mxzAZhuFvzppxxaek3Ef1INLVVK4Biz7
1jctRTokbuguKt8RqbHFfIfRgLJVRbjXNmzO6dW/gPrTCe88ArJjn7chT1Vp
SPoOkvrQUPl6yv7ae5WqliyS8WXYEysTGf+293YsdiAVcX3Q5R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tRL8+pG
J+8Wjd9hK3b2FLGEKfp/8koD9mvWeHIegdG3mOjwtlowLX6qhnyMQuR5r5TF
rol36Qjzm+2rgyfdfJXB6I7C5/rQEVK7r2nMEAy+jeOW1YfaVtpPplOHctlY
A1Mtphdyy1L0x1/VUPlarq2M75TEk7lVN6JGaKEHBvM7unxmfVguh+aQranL
ePB2vbXtiM0GuT8CPHxK2BfaezMcIvlV0x1lL76i6Drw/twp+K9OCXziZsMO
h8Spb2dWQFz/Egf8HAkzG92+2dROIgo5/qWsZMnfdYa5aa8R5dNo1vdj5PL3
D58lhXinajZGrjGwFWNWw63EKfbkLTrfTO1c/SsEu99i6NBXoOezlrmjZvQ6
Q9JbmqV1MhkBZ1zL9eTH117kBFGTic1OquyBuTmj/swJmySyJatux2ykLCK1
mRp5x/JuW/Q8bxcYctfy6MV8JEMHAh1jnK6LudPjH+3cpIt/EtS2lWUK+ax6
q35A6rUE/s1eiqyd6hKDTlA1dXz/eqh7gly6NjE/S5OYK+DpPQsW5Q4ikjZP
95H7NWOuvsKcYnP52gesOL4oijL6DCs/GTqFIIoMklC9lHNWFjKYOpC4Wb3n
+JCa2jt2bN6nKcS+x1FDdKTz/+FMwh6AvexEiwcZntLq2DmcOxPuaU7ccbai
7Ebt+sJ+uoh+2jnLeJglQZN/baMmwxQDJsJbygQ5LbMdZ7KV9lpvnun8GJZv
kLFPOAvhp64XGejH6Tnd8G7/nu+fc4aHWqYw6RcWHnSeMUJ3gFlplWGR6Q3v
hMJXuXuAncyS+fookYdq4CTdpUF6HfNV1Yjx6B15s077M65C5q8ox/8A0DbJ
hA==
"], {{0, 0}, {100, 50}}, {0, 40}],
Frame->Automatic,
FrameLabel->{None, None},
FrameTicks->{{None, None}, {None, None}}], ",",
GraphicsBox[RasterBox[CompressedData["
1:eJy9l8fZxDxyhP9v6EmAhPfeBaBQFMI+uiv/m7AbhA5zm5kG0N1Vb+V//e9/
/+v3zz///Nf8/M/8fPC5cqcVPSp5O7i178ljeZIrqnUoK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