HyperGraph
Changes
HyperGraph/Diagram/Class Diagram.cd 49(+49 -0)
HyperGraph/Diagram/class diagram.graphml 155(+155 -0)
HyperGraph/Diagram/class diagram.jpg 0(+0 -0)
HyperGraph/HyperGraph.csproj 5(+5 -0)
HyperGraph/Program.cs 30(+15 -15)
Details
HyperGraph/Diagram/Class Diagram.cd 49(+49 -0)
diff --git a/HyperGraph/Diagram/Class Diagram.cd b/HyperGraph/Diagram/Class Diagram.cd
new file mode 100644
index 0000000..38b0e1e
--- /dev/null
+++ b/HyperGraph/Diagram/Class Diagram.cd
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="FullSignature">
+ <Class Name="HyperGraph.Combinatorics<T>">
+ <Position X="14" Y="2.5" Width="5.5" />
+ <TypeIdentifier>
+ <HashCode>AAAAAAAAAAAAAAAAAQAAAAAEAAgBAAAAAAAAAAAAAAA=</HashCode>
+ <FileName>Combinatorics.cs</FileName>
+ </TypeIdentifier>
+ </Class>
+ <Class Name="HyperGraph.HyperGraph">
+ <Position X="4.25" Y="8" Width="5.5" />
+ <TypeIdentifier>
+ <HashCode>AAAAAAAAACAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+ <FileName>HyperGraph.cs</FileName>
+ </TypeIdentifier>
+ </Class>
+ <Class Name="HyperGraph.Matrix<T>">
+ <Position X="14" Y="4.5" Width="5.5" />
+ <TypeIdentifier>
+ <HashCode>AAAAAAAAAAACABgACABAACAAAAAAAAAQEAAAAAEAAAA=</HashCode>
+ <FileName>Matrix.cs</FileName>
+ </TypeIdentifier>
+ </Class>
+ <Class Name="HyperGraph.Program">
+ <Position X="4.25" Y="1" Width="5.5" />
+ <TypeIdentifier>
+ <HashCode>AAAAAAAAAQAAAAAAAgAAABCAAAAIIAAAAAAEBAAAAAA=</HashCode>
+ <FileName>Program.cs</FileName>
+ </TypeIdentifier>
+ </Class>
+ <Class Name="HyperGraph.Theorem">
+ <Position X="4.25" Y="3.75" Width="5.5" />
+ <Compartments>
+ <Compartment Name="Nested Types" Collapsed="false" />
+ </Compartments>
+ <NestedTypes>
+ <Struct Name="HyperGraph.Theorem.TheoremAuto">
+ <TypeIdentifier>
+ <NewMemberFileName>Theorem.cs</NewMemberFileName>
+ </TypeIdentifier>
+ </Struct>
+ </NestedTypes>
+ <TypeIdentifier>
+ <HashCode>AAAAABAAAQACAAAAAAAAAAIAAACAAAAAAAAAAAAAAAA=</HashCode>
+ <FileName>Theorem.cs</FileName>
+ </TypeIdentifier>
+ </Class>
+ <Font Name="Segoe UI" Size="9" />
+</ClassDiagram>
\ No newline at end of file
HyperGraph/Diagram/class diagram.graphml 155(+155 -0)
diff --git a/HyperGraph/Diagram/class diagram.graphml b/HyperGraph/Diagram/class diagram.graphml
new file mode 100644
index 0000000..08a8773
--- /dev/null
+++ b/HyperGraph/Diagram/class diagram.graphml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:java="http://www.yworks.com/xml/yfiles-common/1.0/java" xmlns:sys="http://www.yworks.com/xml/yfiles-common/markup/primitives/2.0" xmlns:x="http://www.yworks.com/xml/yfiles-common/markup/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
+ <!--Created by yEd 3.19-->
+ <key attr.name="Description" attr.type="string" for="graph" id="d0"/>
+ <key for="port" id="d1" yfiles.type="portgraphics"/>
+ <key for="port" id="d2" yfiles.type="portgeometry"/>
+ <key for="port" id="d3" yfiles.type="portuserdata"/>
+ <key attr.name="url" attr.type="string" for="node" id="d4"/>
+ <key attr.name="description" attr.type="string" for="node" id="d5"/>
+ <key for="node" id="d6" yfiles.type="nodegraphics"/>
+ <key for="graphml" id="d7" yfiles.type="resources"/>
+ <key attr.name="url" attr.type="string" for="edge" id="d8"/>
+ <key attr.name="description" attr.type="string" for="edge" id="d9"/>
+ <key for="edge" id="d10" yfiles.type="edgegraphics"/>
+ <graph edgedefault="directed" id="G">
+ <data key="d0"/>
+ <node id="n0">
+ <data key="d5"/>
+ <data key="d6">
+ <y:GenericNode configuration="com.yworks.entityRelationship.big_entity">
+ <y:Geometry height="162.0" width="476.8" x="-88.79999999999995" y="122.0"/>
+ <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
+ <y:BorderStyle color="#000000" type="line" width="1.0"/>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#B7C9E3" configuration="com.yworks.entityRelationship.label.name" fontFamily="Dialog" fontSize="16" fontStyle="bold" hasLineColor="false" height="23.6015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="120.8828125" x="177.95859375" xml:space="preserve" y="4.0">класс Theorem</y:NodeLabel>
+ <y:NodeLabel alignment="left" autoSizePolicy="content" borderDistance="0.0" configuration="com.yworks.entityRelationship.label.attributes" fontFamily="Dialog" fontSize="14" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="124.0595703125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="b" textColor="#000000" verticalTextPosition="top" visible="true" width="478.9541015625" x="-1.0770507812499943" xml:space="preserve" y="37.9404296875">_____________________________________________________________
+ - Factorial() : long
+ - Pow() : long
+ + isEqualNumberOfVertices() : bool
+ + TheoremAutomorphism() : TheoremAuto
+ + TheoremAutomorphismForEqualNumberOfVertices() : TheoremAuto
+ </y:NodeLabel>
+ <y:StyleProperties>
+ <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="false"/>
+ </y:StyleProperties>
+ </y:GenericNode>
+ </data>
+ </node>
+ <node id="n1">
+ <data key="d5"/>
+ <data key="d6">
+ <y:GenericNode configuration="com.yworks.entityRelationship.big_entity">
+ <y:Geometry height="214.0" width="236.8" x="-88.79999999999995" y="-107.0"/>
+ <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
+ <y:BorderStyle color="#000000" type="line" width="1.0"/>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#B7C9E3" configuration="com.yworks.entityRelationship.label.name" fontFamily="Dialog" fontSize="16" fontStyle="bold" hasLineColor="false" height="23.6015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="119.109375" x="58.845312500000006" xml:space="preserve" y="4.0">класс Program</y:NodeLabel>
+ <y:NodeLabel alignment="left" autoSizePolicy="content" borderDistance="0.0" configuration="com.yworks.entityRelationship.label.attributes" fontFamily="Dialog" fontSize="14" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="175.513671875" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="br" textColor="#000000" verticalTextPosition="top" visible="true" width="237.583984375" x="-0.7839843749999886" xml:space="preserve" y="38.486328125">______________________________
+ - Main() : void
+ - Menu() : void
+ - ExampleAllTranspos() : void
+ - ExampleTheorema() : void
+ - ExampleTheoremaThird() : void
+ - LoadStreamReader() : bool
+ - LoadStreamWriter() : bool
+ - PrintError() : void
+ </y:NodeLabel>
+ <y:StyleProperties>
+ <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="false"/>
+ </y:StyleProperties>
+ </y:GenericNode>
+ </data>
+ </node>
+ <node id="n2">
+ <data key="d5"/>
+ <data key="d6">
+ <y:GenericNode configuration="com.yworks.entityRelationship.big_entity">
+ <y:Geometry height="181.0" width="236.8" x="-88.79999999999995" y="304.0"/>
+ <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
+ <y:BorderStyle color="#000000" type="line" width="1.0"/>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#B7C9E3" configuration="com.yworks.entityRelationship.label.name" fontFamily="Dialog" fontSize="16" fontStyle="bold" hasLineColor="false" height="23.6015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="145.78125" x="45.509375000000006" xml:space="preserve" y="4.0">класс HyperGraph</y:NodeLabel>
+ <y:NodeLabel alignment="left" autoSizePolicy="content" borderDistance="0.0" configuration="com.yworks.entityRelationship.label.attributes" fontFamily="Dialog" fontSize="14" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="141.2109375" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="b" textColor="#000000" verticalTextPosition="top" visible="true" width="237.583984375" x="-0.3919921874999943" xml:space="preserve" y="39.7890625"> + HyperEdge : List<List<string>>
+______________________________
+ - ~HyperGraph()
+ + HyperGraph ( HyperGraph )
+ + HyperGraph ( Matrix<int> )
+ + Dispose() : void
+ + ToString() : string
+ </y:NodeLabel>
+ <y:StyleProperties>
+ <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="false"/>
+ </y:StyleProperties>
+ </y:GenericNode>
+ </data>
+ </node>
+ <node id="n3">
+ <data key="d5"/>
+ <data key="d6">
+ <y:GenericNode configuration="com.yworks.entityRelationship.big_entity">
+ <y:Geometry height="109.0" width="284.8" x="167.4000000000001" y="-91.0"/>
+ <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
+ <y:BorderStyle color="#000000" type="line" width="1.0"/>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#B7C9E3" configuration="com.yworks.entityRelationship.label.name" fontFamily="Dialog" fontSize="16" fontStyle="bold" hasLineColor="false" height="23.6015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="191.265625" x="46.767187500000006" xml:space="preserve" y="4.0">структура TheoremAuto</y:NodeLabel>
+ <y:NodeLabel alignment="left" autoSizePolicy="content" borderDistance="0.0" configuration="com.yworks.entityRelationship.label.attributes" fontFamily="Dialog" fontSize="14" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="72.60546875" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="b" textColor="#000000" verticalTextPosition="top" visible="true" width="280.5068359375" x="2.1465820312500057" xml:space="preserve" y="36.39453125"> + AutomorphismNodes : List<string>
+ + CountAutomorphism : long
+ + GraphWithoutAutoEdges : HyperGraph
+ + isSatisfyTheorem : bool</y:NodeLabel>
+ <y:StyleProperties>
+ <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="false"/>
+ </y:StyleProperties>
+ </y:GenericNode>
+ </data>
+ </node>
+ <node id="n4">
+ <data key="d5"/>
+ <data key="d6">
+ <y:GenericNode configuration="com.yworks.entityRelationship.big_entity">
+ <y:Geometry height="145.0" width="445.79999999999995" x="394.4000000000001" y="122.0"/>
+ <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
+ <y:BorderStyle color="#000000" type="line" width="1.0"/>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#B7C9E3" configuration="com.yworks.entityRelationship.label.name" fontFamily="Dialog" fontSize="16" fontStyle="bold" hasLineColor="false" height="23.6015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="420.75" x="12.524999999999977" xml:space="preserve" y="4.0">универсальный статичный класс Combinatorics <T></y:NodeLabel>
+ <y:NodeLabel alignment="left" autoSizePolicy="content" borderDistance="0.0" configuration="com.yworks.entityRelationship.label.attributes" fontFamily="Dialog" fontSize="14" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="106.908203125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="br" textColor="#000000" verticalTextPosition="top" visible="true" width="447.8095703125" x="-2.0095703125000455" xml:space="preserve" y="38.091796875">_________________________________________________________
+ + combinationWithReplays(int n, int m) : List<List<int>>
+ + Transposition(List<T> array) : List<List<T>>
+ - AddInOrderFromList() : List<T>
+ - Swap() : bool
+ </y:NodeLabel>
+ <y:StyleProperties>
+ <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="false"/>
+ </y:StyleProperties>
+ </y:GenericNode>
+ </data>
+ </node>
+ <node id="n5">
+ <data key="d5"/>
+ <data key="d6">
+ <y:GenericNode configuration="com.yworks.entityRelationship.big_entity">
+ <y:Geometry height="298.0" width="319.8" x="178.00000000000009" y="304.0"/>
+ <y:Fill color="#E8EEF7" color2="#B7C9E3" transparent="false"/>
+ <y:BorderStyle color="#000000" type="line" width="1.0"/>
+ <y:NodeLabel alignment="center" autoSizePolicy="content" backgroundColor="#B7C9E3" configuration="com.yworks.entityRelationship.label.name" fontFamily="Dialog" fontSize="16" fontStyle="bold" hasLineColor="false" height="23.6015625" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="t" textColor="#000000" verticalTextPosition="bottom" visible="true" width="232.75" x="43.525000000000006" xml:space="preserve" y="4.0">универсальный класс Matrix</y:NodeLabel>
+ <y:NodeLabel alignment="left" autoSizePolicy="content" borderDistance="0.0" configuration="com.yworks.entityRelationship.label.attributes" fontFamily="Dialog" fontSize="14" fontStyle="bold" hasBackgroundColor="false" hasLineColor="false" height="261.2705078125" horizontalTextPosition="center" iconTextGap="4" modelName="internal" modelPosition="b" textColor="#000000" verticalTextPosition="top" visible="true" width="323.2314453125" x="-1.7157226562499943" xml:space="preserve" y="36.7294921875"> + countColumn : int
+ + countRow : int
+ + matrix : List<List<T>>
+ + this [int pos, bool isColumn = false] : List<T>
+ + this [int posRow, int posColumn] : T
+_________________________________________
+ + Matrix ( )
+ + Matrix ( int count, [bool isColumn = false] )
+ + Matrix ( int countR0w, int countCol )
+ + LoadFromStream () : Matrix <T>
+ + AddColumn () : bool
+ + AddRow () : bool
+ + UnloadToStream () : bool
+ - ConvertValue <t, U> () : t
+ </y:NodeLabel>
+ <y:StyleProperties>
+ <y:Property class="java.lang.Boolean" name="y.view.ShadowNodePainter.SHADOW_PAINTING" value="false"/>
+ </y:StyleProperties>
+ </y:GenericNode>
+ </data>
+ </node>
+ </graph>
+ <data key="d7">
+ <y:Resources/>
+ </data>
+</graphml>
HyperGraph/Diagram/class diagram.jpg 0(+0 -0)
diff --git a/HyperGraph/Diagram/class diagram.jpg b/HyperGraph/Diagram/class diagram.jpg
new file mode 100644
index 0000000..a39731f
Binary files /dev/null and b/HyperGraph/Diagram/class diagram.jpg differ
HyperGraph/HyperGraph.csproj 5(+5 -0)
diff --git a/HyperGraph/HyperGraph.csproj b/HyperGraph/HyperGraph.csproj
index 670d2f4..3a0d60e 100644
--- a/HyperGraph/HyperGraph.csproj
+++ b/HyperGraph/HyperGraph.csproj
@@ -50,6 +50,11 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
+ <None Include="Diagram\Class Diagram.cd" />
+ <None Include="Diagram\class diagram.graphml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Diagram\class diagram.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
HyperGraph/Program.cs 30(+15 -15)
diff --git a/HyperGraph/Program.cs b/HyperGraph/Program.cs
index ed9fd2d..b4fe68c 100644
--- a/HyperGraph/Program.cs
+++ b/HyperGraph/Program.cs
@@ -65,7 +65,7 @@ namespace HyperGraph
transpos = Combinatorics<string>.Transposition(graph.HyperEdge[i]);
// Вывод всех вершин текущего гипер-ребра
- output.Write("Current edge include:");
+ output.Write("Текущее ребро включает вершины:");
for (int g = 0; g < graph.HyperEdge[i].Count; g++)
{
output.Write(" {0}", graph.HyperEdge[i][g]);
@@ -106,26 +106,26 @@ namespace HyperGraph
// Если удовлетворяет условию "в каждом гиперребре одинаковое количество вершин", то нужно применять не эту теорему (2), а другую (3)
if (Theorem.isEqualNumberOfVertices(graph))
{
- Console.WriteLine("Is Theorem 2: " + false);
+ Console.WriteLine("Согласно теореме 2: " + false);
Console.WriteLine("\nЧисло автоморфизмов графа должно вычисляться по теореме 3.");
- output.WriteLine("Is Theorem 2: " + false);
+ output.WriteLine("Согласно теореме 2: " + false);
}
else
{
// Выполняется ли условие согласно теореме 2
- Console.WriteLine("Is Theorem 2: " + result.isSatisfyTheorem);
+ Console.WriteLine("Согласно теореме 2: " + result.isSatisfyTheorem);
if (result.isSatisfyTheorem)
{
// Вывод числа автоморфизмов в консоль
- Console.WriteLine("Count of automorphism: " + result.CountAutomorphism);
+ Console.WriteLine("Количество автоморфизмов: " + result.CountAutomorphism);
}
// Выполняется ли условие согласно теореме 2
- output.WriteLine("Is Theorem 2: " + result.isSatisfyTheorem);
+ output.WriteLine("Согласно теореме 2: " + result.isSatisfyTheorem);
// Если да, то вывести
if (result.isSatisfyTheorem)
{
// Вывод вершин и числа автоморфизмов в файл
- output.WriteLine("Automorphism with nodes: ");
+ output.WriteLine("Общие вершины автоморфизмов: ");
foreach (var node in result.AutomorphismNodes)
{
output.Write(node + " ");
@@ -154,7 +154,7 @@ namespace HyperGraph
output.WriteLine("\r\n\t-----------");
}
- output.WriteLine("\r\nCount of automorphism: " + result.CountAutomorphism + "\r\n");
+ output.WriteLine("\r\nКоличество автоморфизмов: " + result.CountAutomorphism + "\r\n");
// Вывести перестановки в файл
ExampleAllTranspos(result.GraphWithoutAutoEdges, output);
@@ -172,25 +172,25 @@ namespace HyperGraph
// Если НЕ удовлетворяет условию "в каждом гиперребре одинаковое количество вершин", то нужно применять не эту теорему (3), а другую (2)
if (!Theorem.isEqualNumberOfVertices(Graph))
{
- Console.WriteLine("Is Theorem 3: " + false);
+ Console.WriteLine("Согласно теореме 3: " + false);
Console.WriteLine("\nЧисло автоморфизмов графа должно вычисляться по теореме 2.");
- output.WriteLine("Is Theorem 3: " + false);
+ output.WriteLine("Согласно теореме 3: " + false);
}
else
{
// Выполняется ли условие согласно теореме 3
- output.WriteLine("Is Theorem 3: " + result.isSatisfyTheorem);
+ output.WriteLine("Согласно теореме 3: " + result.isSatisfyTheorem);
if (result.isSatisfyTheorem)
{
// Вывод числа автоморфизмов в консоль
- Console.WriteLine("Count of automorphism: " + result.CountAutomorphism);
+ Console.WriteLine("Количество автоморфизмов: " + result.CountAutomorphism);
}
- Console.WriteLine("Is Theorem 3: " + result.isSatisfyTheorem);
+ Console.WriteLine("Согласно теореме 3: " + result.isSatisfyTheorem);
// Если да, то вывести
if (result.isSatisfyTheorem)
{
// Вывод вершин и числа автоморфизмов в файл
- output.WriteLine("Automorphism with nodes: ");
+ output.WriteLine("Общие вершины автоморфизмов: ");
foreach (var node in result.AutomorphismNodes)
{
output.Write(node + " ");
@@ -219,7 +219,7 @@ namespace HyperGraph
output.WriteLine("\r\n\t-----------");
}
- output.WriteLine("\r\nCount of automorphism: " + result.CountAutomorphism + "\r\n");
+ output.WriteLine("\r\nКоличество автоморфизмов: " + result.CountAutomorphism + "\r\n");
// Получаю гипер-граф, автоморфизмы которого нужно получить
// Это гипер-граф, из которого удалены общие для всех ребер вершины