-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
58 lines (51 loc) · 867 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"fmt"
"os"
"strconv"
"time"
)
func CheckReadGraph() {
assert(len(TRANS) == 10000)
for _, g := range TRANS {
g.check()
}
}
func PrintReadGraph() {
for _, g := range TRANS {
g.write(os.Stdout)
}
}
func PrintDFSCode() {
var dfs DFSCode
for _, g := range TRANS {
dfs.fromGraph(&g)
dfs.write(os.Stdout)
os.Stdout.WriteString("\n")
}
}
func main() {
var err error
TRANS, err = BuildGraphFromFile("graph.data")
assert(err == nil, err)
var tmp int
switch len(os.Args) {
case 4:
if tmp, err = strconv.Atoi(os.Args[3]); err != nil {
maxpat_max = tmp
}
fallthrough
case 3:
if tmp, err = strconv.Atoi(os.Args[2]); err != nil {
maxpat_min = tmp
}
fallthrough
case 2:
if tmp, err = strconv.Atoi(os.Args[1]); err != nil {
minsup = tmp
}
}
t := time.Now()
Run()
fmt.Println(time.Now().Sub(t))
}