Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Implementing a compute function to calculate PageRank scores

Now that we have completed our brief tour of the Calculator API, it's time to shift our focus to the most important part of the implementation: the compute function.

At the end of each super-step, vertices are expected to evenly distribute their PageRank score to their neighbors. Under our graph processing model, this task is facilitated by broadcasting a message. The IncomingScoreMessage type describes the payload for the exchanged messages:

type IncomingScoreMessage struct {
    Score float64
}

func (pr IncomingScoreMessage) Type() string { return "score" }

To bootstrap the calculator, we need to set the initial PageRank score for every vertex in the graph to the value 1/N, where ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content