comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:ebed2bd0d300
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using libsemtd;
6
7 namespace libbacktrack
8 {
9 public partial class Backtrack
10 {
11 public Backtrack() { throw new NotImplementedException(); }
12 public Backtrack(string graphType, int numVerMain, int numVerDef, int firstLabel, bool isRecurseAll)
13 {
14 this.result = "";
15 this.myGraph = new Semtd(graphType, numVerMain, numVerDef);
16 this.labelVerUsed = new bool[this.myGraph.NumVerTotal + 1];
17 this.isRecurseAll = isRecurseAll;
18 setLabel(0, firstLabel);
19 this.firstLabel = firstLabel;
20 this.pathLabel = this.pathStart = this.pathEnd = 0;
21 switch (graphType)
22 {
23 case "fan":
24 {
25 this.pathStart = 1;
26 this.pathEnd = this.myGraph.NumVerMain - 1;
27 break;
28 }
29 case "wheel":
30 case "doubefan":
31 {
32 this.pathStart = 2;
33 this.pathEnd = this.myGraph.NumVerMain - 1;
34 break;
35 }
36 }
37 }
38 }
39 }