This repository contains code that implements the independent cascade model based on a temporal network.
Make sure you have Go installed (minimum version 1.15).
The program is implemented and based on the formatting of the contents inside android.csv, so if you want to use another data set, please adhere to that same formatting.
You can run the code with the command:
When running it's necessary to specify a file path to the input data file
$ go run main.go -f <relative-file-path>
To see the possible command-line flags that can be passed:
$ go run main.go --help
To build a binary: Run the following command from the root of the repository:
$ go build
$ ./icm -f <relative-file-path>
Example (run from the root of the repository):
$ ./icm -f ./android.csv
To run with docker you can manually build the docker image using the Dockerfile or you can pull the latest docker image.
$ docker pull oskaryil/go_icm
$ docker run -it oskaryil/go_icm
Prerequisites: Go version >= v 1.15
Running tests: $ make test
or $ go test ./...
$ go test ./...
Note that these automated benchmark tests show a much higher time than when timing the code manually.
$ go test -bench=.