pagerank

package
v0.0.0-...-bc4c757 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PageRank

func PageRank(links []Link) (ranks map[int64]float64)

Calculate pagerank given a set of links. The input "links" map, maps a node id to another node id. As an example if links[1] == 2, then node 1 links to node 2.

Return value is a map that maps all node ids to a rank value in [0.0, 1.0] range. The ranks are normalized so that the highest ranking node always has the rank 1.0.

func PerformPageRankOnDb

func PerformPageRankOnDb(db *sql.DB)

Perform PageRank on all the links in the database, and write all page/host ranks to the database.

Types

type Link struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL