module
Version:
v0.0.0-...-7121595
Opens a new window with list of versions in this module.
Published: Aug 16, 2020
License: Apache-2.0
Opens a new window with license information.
README
¶
Undirected and Unweighted Graph
How to use this repo
- Clone this repo and follow the instructions below to run client and server
How to run client and server from commandline
- Open a terminal and following below instructions
- cd undirgraph/binaries
- ./server --ip localhost:50051
- Open another terminal and following below instructions
- cd undirgraph/binaries
- ./client --ip localhost:50051 --crud create --edges "0:1,0:3,1:2,1:4,2:5,3:6,3:4,4:7,4:5,5:8,6:7,7:8"
- output => 2020/08/16 06:05:19 Got this STATUS:Success GRAPH_ID:1000
- NOTE => The number, at the end of output, is the graph id that can be used in other graph operations
- NOTE => The long string, with option --edges, is a list of all edges in an undirected graph
- Here are a few more client commands
- ./client --ip localhost:50051 --crud path --id 1000 --src 0 --dst 8
- ./client --ip localhost:50051 --crud path --id 1001 --src 0 --dst 8
- ./client --ip localhost:50051 --crud delete --id 1001 --src 0 --dst 8
- ./client --ip localhost:50051 --crud path --id 1001 --src 0 --dst 8
How to build client and server binaries
- cd undirgraph/server
- go build
- it generates the server binary in undirgraph/server directory
- cd undirgraph/client
- go build
- it generates a client binary in undirgraph/client directory
How to run tests
- cd undirgraph/server
- go test -v -bench=.
- it generates following output
- $ go test -v -bench=.
- === RUN TestCreate
- --- PASS: TestCreate (0.00s)
- === RUN TestTableCreate
- --- PASS: TestTableCreate (0.00s)
- goos: darwin
- goarch: amd64
- pkg: github.com/arvin4181/undirgraph/server
- BenchmarkShortestPath-8 437756 2365 ns/op
- PASS
- ok github.com/arvin4181/undirgraph/server 1.430s
How to run server in a docker container
How to run server as a microserice
*TBD
Directories
¶
api
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.