private static void WriteParts(BipartiteGraphReader reader) { var firstRow = string.Join(" ", reader.PartEven.Select(x => x.ToString())); var secondRow = string.Join(" ", reader.PartOdd.Select(x => x.ToString())); var result = new List <string> { "Y", firstRow, secondRow }; File.WriteAllLines("out.txt", result); }
private static void Main(string[] args) { args = File.ReadAllLines("in.txt"); var reader = new BipartiteGraphReader(args); var success = reader.IsGraphBipartite(); if (!success) { File.WriteAllText("out.txt", "N"); } else { WriteParts(reader); } }
public void TestBiggerBigraph() { var reader = new BipartiteGraphReader(new [] { "8", "2 4 0", "1 3 0", "2 4 0", "1 3 5 0", "6 0", "7 8 0", "0", "0" }); reader.IsGraphBipartite().Should().BeTrue(); }
public void SetUp() { noBiGraphReader = new BipartiteGraphReader(notBipartiteArgs); biGraphReader = new BipartiteGraphReader(bipartiteArgs); }