Beispiel #1
0
 static void Merge(Vertex a, Vertex b, int nameA, int nameB)
 {
     name[b] = nameA;
     var c = next[b];
     while (name[c] != nameA)
     {
         name[c] = nameA;
         c = next[c];
     }
     size[nameA] += size[nameB];
     c = next[a];
     next[a] = next[b];
     next[b] = c;
 }
Beispiel #2
0
 public static int SizeOf(Vertex a, Vertex b) =>
     Math.Abs(a.X - b.X) + Math.Abs(a.Y - b.Y);
Beispiel #3
0
 public Edge(Vertex a, Vertex b)
 {
     A = a;
     B = b;
 }