GraphSplit/main.go

35 lines
643 B
Go
Raw Permalink Normal View History

2024-04-18 00:31:23 +02:00
package main
import (
"fmt"
)
2024-04-18 01:34:38 +02:00
func main() {
// Create a session with a random ID and read the graph from file
session := &Session{
ID: generateRandomID(),
Graph: nil,
2024-04-18 00:31:23 +02:00
}
// Read graph from file
graph, err := ReadGraphFromFile("graph.txt")
if err != nil {
fmt.Println("Error reading graph:", err)
return
}
2024-04-18 01:34:38 +02:00
// Set the graph for the session
session.Graph = graph
fmt.Println("Session ID:", session.ID)
2024-04-18 00:31:23 +02:00
fmt.Println("Graph:")
2024-04-18 01:34:38 +02:00
PrettyPrintGraph(graph)
CompleteSplit(session, graph.Start)
CompleteSplit(session, graph.Splits[1])
CompleteSplit(session, graph.Splits[2])
PrettyPrintGraph(graph)
fmt.Println("Done.")
2024-04-18 00:31:23 +02:00
}