annotate defical-sharp/libbacktrack/backtrack.cs @ 0:ebed2bd0d300

Initial import from svn. History be damned.
author Edho P. Arief <me@myconan.net>
date Fri, 02 Apr 2010 23:11:57 +0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
1 using System;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
2 using System.Collections.Generic;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
3 using System.Linq;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
4 using System.Text;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
5 using libsemtd;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
6
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
7 namespace libbacktrack
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
8 {
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
9 public partial class Backtrack
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
10 {
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
11 public Backtrack() { throw new NotImplementedException(); }
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
12 public Backtrack(string graphType, int numVerMain, int numVerDef, int firstLabel, bool isRecurseAll)
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
13 {
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
14 this.result = "";
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
15 this.myGraph = new Semtd(graphType, numVerMain, numVerDef);
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
16 this.labelVerUsed = new bool[this.myGraph.NumVerTotal + 1];
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
17 this.isRecurseAll = isRecurseAll;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
18 setLabel(0, firstLabel);
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
19 this.firstLabel = firstLabel;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
20 this.pathLabel = this.pathStart = this.pathEnd = 0;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
21 switch (graphType)
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
22 {
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
23 case "fan":
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
24 {
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
25 this.pathStart = 1;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
26 this.pathEnd = this.myGraph.NumVerMain - 1;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
27 break;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
28 }
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
29 case "wheel":
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
30 case "doubefan":
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
31 {
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
32 this.pathStart = 2;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
33 this.pathEnd = this.myGraph.NumVerMain - 1;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
34 break;
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
35 }
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
36 }
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
37 }
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
38 }
ebed2bd0d300 Initial import from svn. History be damned.
Edho P. Arief <me@myconan.net>
parents:
diff changeset
39 }