using System.Collections.Generic;
using System.Text.RegularExpressions;
using s_network = Struct_SimpeNetwork.SimpleNetwork;
using s_vertex = Struct_SimpeNetwork.SimpleNetwork.SimpleVertex;
using s_edge = Struct_SimpeNetwork.SimpleNetwork.SimpleEdge;
public struct Struct_SimpeNetwork
public struct SimpleNetwork
public IList<SimpleVertex> arr_vertexes;
public IList<SimpleEdge> arr_edges;
public int num_of_vertexes;
public struct SimpleVertex
public ConsoleColor color;
public int x_coord, y_coord;
public SimpleVertex begin_SimpleVertex;
public SimpleVertex end_SimpleVertex;
public ConsoleColor color;
public static void Main(string[] args)
s_network netw = new s_network();
netw.arr_vertexes = new List<s_vertex>();
netw.arr_edges = new List<s_edge>();
netw.num_of_vertexes = 5;
netw.num_of_edges = netw.num_of_vertexes-1;
for(int num_i = 0; num_i < netw.num_of_vertexes; num_i++)
s_vertex new_v = new s_vertex();
new_v.color = (ConsoleColor)num_i;
new_v.x_coord = (Num+2*num_i)%21;
new_v.y_coord = (Num+2*num_i)%22;
netw.arr_vertexes.Add(new_v);
for(int num_i = 0; num_i < netw.num_of_edges; num_i++)
s_edge new_ed = new s_edge();
new_ed.begin_SimpleVertex = netw.arr_vertexes[num_i];
new_ed.end_SimpleVertex = netw.arr_vertexes[num_i + 1];
new_ed.color = new_ed.begin_SimpleVertex.color;
netw.arr_edges.Add(new_ed);
for(int num_i = 0; num_i < netw.num_of_vertexes; num_i++)
s_vertex v = netw.arr_vertexes[num_i];
v.x_coord = ((Num + 100*num_i)%31)/2;
v.y_coord = (Num + 100*num_i)%22;
netw.arr_vertexes[num_i] = v;
for(int num_i = 0; num_i < netw.num_of_edges; num_i++)
s_edge ed = netw.arr_edges[num_i];
ed.begin_SimpleVertex = netw.arr_vertexes[(Num / (num_i+1))%netw.num_of_vertexes];
ed.end_SimpleVertex = netw.arr_vertexes[(Num + num_i*num_i)%netw.num_of_vertexes];
ed.color = ed.begin_SimpleVertex.color;
netw.arr_edges[num_i] = ed;
public static void OutNetworkData(s_network network)
string str = "Vertex'es data:";
for(int num_i = 0; num_i < network.num_of_vertexes; num_i++)
str = "number = " + network.arr_vertexes[num_i].number.ToString() +
", Color = " + network.arr_vertexes[num_i].color.ToString() +
", x = " + network.arr_vertexes[num_i].x_coord.ToString() +
", y = " + network.arr_vertexes[num_i].y_coord.ToString();
for(int num_i = 0; num_i < network.num_of_edges; num_i++)
str = "index " + num_i.ToString() + ": begin_Vertex = {number = " +
network.arr_edges[num_i].begin_SimpleVertex.number.ToString() +
", color = " + network.arr_edges[num_i].begin_SimpleVertex.color.ToString() +
"},\n end_Vertex = {number = " + network.arr_edges[num_i].end_SimpleVertex.number.ToString() +
", color = " + network.arr_edges[num_i].end_SimpleVertex.color.ToString() +
"}, edge's color = " + network.arr_edges[num_i].color.ToString();