github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/dag/alg.go (about)

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package dag
     6  
     7  // Transpose reverses all edges in g.
     8  func (g *Graph) Transpose()
     9  
    10  // Topo returns a topological sort of g. This function is deterministic.
    11  func (g *Graph) Topo() []string
    12  
    13  // TransitiveReduction removes edges from g that are transitively
    14  // reachable. g must be transitively closed.
    15  func (g *Graph) TransitiveReduction()