using
System;
using
System.Collections.Generic;
class
GFG {
static
void
hyperGraph()
{
Dictionary<
string
, List<
int
>> hypergraph =
new
Dictionary<
string
, List<
int
>>();
hypergraph.Add(
"e1"
,
new
List<
int
>{1, 2, 3});
hypergraph.Add(
"e2"
,
new
List<
int
>{3, 4, 5});
hypergraph.Add(
"e3"
,
new
List<
int
>{2, 4, 6});
hypergraph.Add(
"e4"
,
new
List<
int
>{1, 5, 6});
hypergraph.Remove(
"e2"
);
hypergraph[
"e1"
] =
new
List<
int
>{1, 2};
Console.WriteLine(
"Hypergraph:"
);
foreach
(KeyValuePair<
string
,List<
int
>> entry
in
hypergraph)
{
string
edge = entry.Key;
Console.Write(edge +
" : "
);
List<
int
> vertices=entry.Value;
foreach
(
var
vertex
in
vertices) {
Console.Write(vertex +
" "
);
}
Console.WriteLine();
}
}
public
static
void
Main()
{
hyperGraph();
}
}