From 06048d8a2aacc40be12c1ee5c489693cc2c56079 Mon Sep 17 00:00:00 2001 From: filifa Date: Tue, 6 May 2025 22:30:04 -0400 Subject: [PATCH] remove AbsorbingNodes method --- cmd/internal/graph/graph.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/cmd/internal/graph/graph.go b/cmd/internal/graph/graph.go index 8453ea5..7ab1372 100644 --- a/cmd/internal/graph/graph.go +++ b/cmd/internal/graph/graph.go @@ -17,7 +17,6 @@ along with this program. If not, see . package graph import ( - "gonum.org/v1/gonum/graph" "gonum.org/v1/gonum/graph/multi" "gonum.org/v1/gonum/graph/simple" "gonum.org/v1/gonum/mat" @@ -34,27 +33,6 @@ func NewDirectedGraph() *DirectedGraph { return &DirectedGraph{WeightedDirectedGraph: multi.NewWeightedDirectedGraph()} } -// AbsorbingNodes returns all the nodes in the Markov chain identified as -// absorbing nodes. -func (g *DirectedGraph) AbsorbingNodes() []graph.Node { - absorbingNodes := make([]graph.Node, 0) - for nodes := g.Nodes(); nodes.Next(); { - u := nodes.Node() - successors := g.From(u.ID()) - if successors.Len() != 1 { - continue - } - - successors.Next() - v := successors.Node() - if u == v { - absorbingNodes = append(absorbingNodes, u) - } - } - - return absorbingNodes -} - // AdjacencyMatrix returns the graph's adjacency matrix. func (g *DirectedGraph) AdjacencyMatrix() *mat.Dense { adj := simple.NewDirectedMatrix(g.Nodes().Len(), 0, 0, 0)