public static void Go() { using (var graphIO = new GraphEnumerator(WinnersFile, MinVertices, MaxVertices)) { graphIO.FileRoot = @"C:\Users\landon\Google Drive\research\Graph6\graph"; foreach (var g in graphIO.EnumerateGraph6File()) { if (MaxIndependenceNumber < int.MaxValue) { if (g.EnumerateMaximalIndependentSets().Any(mis => mis.Count > MaxIndependenceNumber)) { continue; } } if (MaxDegree < int.MaxValue && g.MaxDegree > MaxDegree) { continue; } if (AT) { System.Console.Write("checking " + g.ToGraph6() + "..."); if (!g.IsOnlineFGChoosable(v => g.Degree(v) - 1, v => 1)) { System.Console.WriteLine(" not paintable"); } else { var result = HasFOrientation(g, v => g.Degree(v) - 1, true); if (result != null) { graphIO.AddWinner(g, result.Graph); System.Console.WriteLine(string.Format(" is d_1-AT")); } else { System.Console.WriteLine(" not AT"); } } } else if (Offline) { if (g.EnumerateMaximalIndependentSets().Any(I => I.Count > 2)) { continue; } System.Console.Write("checking " + g.ToGraph6() + "..."); List <List <int> > badAssignment; var bg = new BitGraph_long(g.GetEdgeWeights()); System.Console.Write("checking " + g.ToGraph6() + "..."); if (bg.IsFChoosable(v => bg.Degree(v) - 1, out badAssignment)) { graphIO.AddWinner(g); System.Console.WriteLine(string.Format(" is {0}-fold d_1-choosable", Fold)); } else { System.Console.WriteLine(" not choosable"); } } else { if (!DiamondFreeOnly || !g.ContainsInduced(Choosability.Graphs.Diamond)) { System.Console.Write("checking " + g.ToGraph6() + "..."); if (g.IsOnlineFGChoosable(v => Fold * g.Degree(v) - 1, v => Fold)) { graphIO.AddWinner(g); System.Console.WriteLine(string.Format(" is {0}-fold d_1-paintable", Fold)); } else { System.Console.WriteLine(" not paintable"); } } else { System.Console.WriteLine("skipping due to diamond " + g.ToGraph6()); } } } } }
public static void Go() { File.Delete(WinnersFile); if (Colors == 5) { Winners.Add(Diamond); } var tokenSource = new CancellationTokenSource(); var token = tokenSource.Token; for (int N = MinVertices; N <= MaxVertices; N++) { System.Console.ForegroundColor = ConsoleColor.DarkCyan; System.Console.WriteLine("Checking " + N + " vertex graphs..."); System.Console.ForegroundColor = ConsoleColor.White; for (var R = MinRingSize; R <= MaxRingSize; R++) { System.Console.ForegroundColor = ConsoleColor.DarkGray; System.Console.WriteLine("Checking ring size " + R + "..."); System.Console.ForegroundColor = ConsoleColor.White; var path = string.Format(@"C:\Users\landon\Google Drive\research\Graph6\triangulation\disk\triangulation{0}_{1}.g6.tri.weighted.txt", N, R); if (!File.Exists(path)) { continue; } foreach (var h in path.EnumerateWeightedGraphs()) { foreach (var g in EnumerateWeightings(h)) { if (AT) { var result = g.HasFOrientation(v => g.Degree(v) - g.VertexWeight[v] - (5 - Colors)); if (result != null) { result.Graph.VertexWeight = g.VertexWeight; var hh = result.Graph.EliminateSinks(); if (hh.E > 0) { Winners.Add(hh); hh.AppendWeightStringToFile(WinnersFile); System.Console.ForegroundColor = ConsoleColor.Green; System.Console.WriteLine(string.Format("found {0} AT graph{1} so far", Winners.Count, Winners.Count > 1 ? "s" : "")); System.Console.ForegroundColor = ConsoleColor.White; } } else { } } else if (Offline) { List <List <int> > badAssignment; var bg = new BitGraph_long(g.GetEdgeWeights()); if (bg.IsFChoosable(v => bg.Degree(v) - g.VertexWeight[v] - (5 - Colors), out badAssignment)) { Winners.Add(g); g.AppendWeightStringToFile(WinnersFile); System.Console.ForegroundColor = ConsoleColor.Green; System.Console.WriteLine(string.Format("found {0} choosable graph{1} so far", Winners.Count, Winners.Count > 1 ? "s" : "")); System.Console.ForegroundColor = ConsoleColor.White; } } else { if (g.IsOnlineFChoosable(v => g.Degree(v) - g.VertexWeight[v] - (5 - Colors), token)) { Winners.Add(g); g.AppendWeightStringToFile(WinnersFile); System.Console.ForegroundColor = ConsoleColor.Green; System.Console.WriteLine(string.Format("found {0} paintable graph{1} so far", Winners.Count, Winners.Count > 1 ? "s" : "")); System.Console.ForegroundColor = ConsoleColor.White; } } } } } } }
public static void Go() { using (var graphEnumerator = new GraphEnumerator(WinnersFile, MinVertices, MaxVertices, false)) { graphEnumerator.FileRoot = @"C:\Users\landon\Google Drive\research\Graph6\graph"; graphEnumerator.WeightCondition = WeightCondition; graphEnumerator.OnlyExcludeBySpanningSubgraphs = false; foreach (var g in graphEnumerator.EnumerateGraph6File(Filter, EnumerateWeightings, induced: true)) { if (MaxIndependenceNumber < int.MaxValue) { if (g.EnumerateMaximalIndependentSets().Any(mis => mis.Count > MaxIndependenceNumber)) { continue; } } if (g.MaxDegree > MaxDegree) { continue; } if (g.MinDegree < MinDegree) { continue; } if (Mic) { System.Console.Write("checking " + g.ToGraph6() + " with weights [" + string.Join(",", g.VertexWeight) + "] ..."); var micScore = g.Vertices.Sum(v => g.VertexWeight[v] + 1); if (g.Mic() >= micScore) { graphEnumerator.AddWinner(g); System.Console.WriteLine(string.Format(" is f-KP")); } else { System.Console.WriteLine(" not f-mic'able"); } } else if (AT) { System.Console.Write("checking " + g.ToGraph6() + " with weights [" + string.Join(",", g.VertexWeight) + "] ..."); if (!Not) { if (!g.IsOnlineFGChoosable(v => g.Degree(v) - g.VertexWeight[v], v => 1)) { System.Console.WriteLine(" not paintable"); } else { var result = HasFOrientation(g, v => g.Degree(v) - g.VertexWeight[v], true); if (result != null) { if (OddAT) { if (Math.Abs(result.Even - result.Odd) % 2 == 1) { graphEnumerator.AddWinner(g, result.Graph); System.Console.WriteLine(string.Format(" is odd f-AT")); } else { System.Console.WriteLine(string.Format(" not odd f-AT")); } } else { graphEnumerator.AddWinner(g, result.Graph); System.Console.WriteLine(string.Format(" is f-AT")); } } else { System.Console.WriteLine(" not AT"); } } } else { var good = !g.IsOnlineFGChoosable(v => g.Degree(v) - g.VertexWeight[v], v => 1); var result = HasFOrientation(g, v => g.Degree(v) - g.VertexWeight[v], true); good |= result == null || OddAT && Math.Abs(result.Even - result.Odd) % 2 == 0; if (good) { graphEnumerator.AddWinner(g); System.Console.WriteLine(string.Format(" not f-AT")); } else { System.Console.WriteLine(" is AT"); } } } else if (Offline) { List <List <int> > badAssignment; var bg = new BitGraph_long(g.GetEdgeWeights()); System.Console.Write("checking " + " with weights [" + string.Join(",", g.VertexWeight) + "] ..."); if (bg.IsFChoosable(v => bg.Degree(v) - g.VertexWeight[v], out badAssignment)) { graphEnumerator.AddWinner(g); System.Console.WriteLine(string.Format(" is {0}-fold f-choosable", Fold)); } else { System.Console.WriteLine(" not choosable"); } } else { System.Console.Write("checking " + " with weights [" + string.Join(",", g.VertexWeight) + "] ..."); if (!Not) { if (g.IsOnlineFGChoosable(v => Fold * g.Degree(v) - g.VertexWeight[v], v => Fold)) { graphEnumerator.AddWinner(g); System.Console.WriteLine(string.Format(" is {0}-fold f-paintable", Fold)); } else { System.Console.WriteLine(" not paintable"); } } else { if (!g.IsOnlineFGChoosable(v => Fold * g.Degree(v) - g.VertexWeight[v], v => Fold)) { graphEnumerator.AddWinner(g); System.Console.WriteLine(string.Format(" is not {0}-fold f-paintable", Fold)); } else { System.Console.WriteLine(" paintable"); } } } } } if (Not) { EliminateDoubleEdgeNotSubdivisions.Go(WinnersFile, AT); } else { EliminiteDoubleEdgeSubdivisions.Go(WinnersFile); } }