Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Text.RegularExpressions;
- namespace GraphCsh
- {
- internal class Graph
- {
- public static Graph Generate(string filename)
- {
- Graph gr = new Graph();
- StreamReader file = new StreamReader(filename);
- string filestring;
- while ((filestring = file.ReadLine()) != null)
- {
- Regex regex = new Regex(@"[\d|-1]");
- }
- return gr;
- }
- Stack<Node> _stack = new Stack<Node>();
- }
- internal class Node
- {
- private static int numOfNodes;
- public readonly int Num;
- static Node()
- {
- numOfNodes = 0;
- }
- public Node()
- {
- numOfNodes++;
- Num = numOfNodes;
- }
- public NodeColour Colour
- {
- get
- {
- return colour;
- }
- }
- public void SetBlack()
- {
- colour = NodeColour.Black;
- Console.WriteLine($"Вершина {Num} Окрашена");
- }
- private NodeColour colour = NodeColour.White;
- private Node[] _out;
- public static bool operator true(Node node)
- {
- return ((int)node.colour)==1;
- }
- public static bool operator false(Node node)
- {
- return ((int)node.colour)==0;
- }
- internal enum NodeColour : int{White = 1,Black = 0}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement