Îõ³h&'ô& Û      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ!Copyright © 2018-2021 Kadena LLC.MITLars Kuhtz  experimental Safe-Inferred;?ÂÑÚCdigraph Shortest path matrix of a graph.digraph1Adjacency set representation of a directed graph.digraph4Adjacency matrix representation of a directed graph.digraphèAssumes that the input is an directed graph and that the vertex set is a prefix of the natural numbers.digraphËConverts an adjacency matrix into a graph in adjacnency set representation.digraph0Shortest path computation for integral matrixes.digraphäCompute a shortest path between two vertices of a graph from the shortest path matrix of the graph.digrapháCompute the distance between two vertices of a graph from the shortest path matrix of the graph. digraphËCompute the diameter of a graph from the shortest path matrix of the graph.[digraphDistance matrix for int inputs.\digraphFloyd-Warshall With Path MatrixßTODO: use a mutable array? TODO: implement Dijkstra's algorithm for adj matrix representation. digraph>Floyd Warshall Without Paths (more efficient, by factor of 2). digraph>Floyd Warshall Without Paths (more efficient, by factor of 2).ßTODO: use a mutable array? TODO: implement Dijkstra's algorithm for adj matrix representation. digraphShortest path matrix.=All entries of the result matrix are either whole numbers or Infinity. digraphDiameter of a graph.  !Copyright © 2018-2020 Kadena LLC.MITLars Kuhtz  experimental Safe-Inferred#;=?Üã"8digraph$The shortest path matrix of a graph.ÒThe shortest path matrix of a graph can be used to efficiently query the distance and shortest path between any two vertices of the graph. It can also be used to efficiently compute the diameter of the graph.²Computing the shortest path matrix is expensive for larger graphs. The matrix is computed using the Floyd-Warshall algorithm. The space and time complexity is quadratic in the order‘ of the graph. For sparse graphs there are more efficient algorithms for computing distances and shortest paths between the nodes of the graph.]digraph$The shortest path matrix of a graph.^digraphËmapping from vertices of the graph to indices in the shortest path matrix._digraphËmapping from indices in the shortest path matrix to vertices in the graph.digraph0Adjacency set representation of directed graphs.ÔIt is assumed that each target of an edge is also explicitly a vertex in the graph.ƒIt is not generally required that graphs are irreflexive, but all concrete graphs that are defined in this module are irreflexive.?Undirected graphs are represented as symmetric directed graphs.digraphDirected Edge.digraphºA predicate that asserts that every target of an edge is also a vertex in the graph. Any graph that is constructed without using unsafe methods is guaranteed to satisfy this predicate.digraphThe adjacency sets of a graph.digraph!The set of vertices of the graph.digraphThe set edges of the graph.digraph%The set of adjacent pairs of a graph.digraph%The set of incident edges of a graph.digraph'Construct a graph from adjacency lists.digraph0Unsafely construct a graph from adjacency lists.ŽThis function assumes that the input includes a adjacency list of each vertex that appears in a adjacency list of another vertex. Generally,  should be preferred.digraph5Construct a graph from a foldable structure of edges.digraphThe union of two graphs. digraph,Map a function over all vertices of a graph.!digraph7Transpose a graph, i.e. reverse all edges of the graph."digraphSymmetric closure of a graph.#digraphóInsert an edge. Returns the graph unmodified if the edge is already in the graph. Non-existing vertices are added.$digraphÕInsert a vertex. Returns the graph unmodified if the vertex is already in the graph.%digraph/The order of a graph is the number of vertices.&digraph5Directed Size. This the number of edges of the graph.'digraph5Directed Size. This the number of edges of the graph.(digraphßUndirected Size of a graph. This is the number of edges of the symmetric closure of the graph.)digraph2The number of outgoing edges of vertex in a graph.*digraph2The maximum out-degree of the vertices of a graph.+digraph2The minimum out-degree of the vertices of a graph.,digraph2The number of incoming edges of vertex in a graph.-digraph1The maximum in-degree of the vertices of a graph..digraph1The minimum in-degree of the vertices of a graph./digraph¥Return whether a graph is regular, i.e. whether all vertices have the same out-degree. Note that the latter implies that all vertices also have the same in-degree.0digraphÀReturn whether a graph is symmetric, i.e. whether for each edge (a,b) there is also the edge (b,a) in the graph.1digraphÐReturn whether a graph is irreflexive. A graph is irreflexive if for each edge (a,b) it holds that a \neq b,, i.e there are no self-loops in the graph.2digraph0Return whether a vertex is contained in a graph.3digraph/Return whether an edge is contained in a graph.4digraph4Return whether two vertices are adjacent in a graph.5digraphèCompute the shortest path matrix for a graph. The result can be used to efficiently query the distance and shortest path between any two vertices of the graph. It can also be used to efficiently compute the diameter of the graph.6digraphïCompute the Diameter of a graph, i.e. the maximum length of a shortest path between two vertices in the graph.ôThis is expensive to compute for larger graphs. If also the shortest paths or distances are needed, one should use 50 to cache the result of the search and use the 7, 9, and ;1 to query the respective results from the cache.ðThe algorithm is optimized for dense graphs. For large sparse graphs a more efficient algorithm should be used.7digraph¢Compute the Diameter of a graph from a shortest path matrix. The diameter of a graph is the maximum length of a shortest path between two vertices in the graph.8digraph:Compute the shortest path between two vertices of a graph.×| This is expensive for larger graphs. If more than one path is needed one should use 5, to cache the result of the search and use 9 to query paths from the cache.ðThe algorithm is optimized for dense graphs. For large sparse graphs a more efficient algorithm should be used.9digraphÙCompute the shortest path between two vertices from the shortest path matrix of a graph.ðThe algorithm is optimized for dense graphs. For large sparse graphs a more efficient algorithm should be used.:digraph5Compute the distance between two vertices of a graph.Û| This is expensive for larger graphs. If more than one distance is needed one should use 5, to cache the result of the search and use ; to query paths from the cache.ðThe algorithm is optimized for dense graphs. For large sparse graphs a more efficient algorithm should be used.;digraphÔCompute the distance between two vertices from the shortest path matrix of a graph.ðThe algorithm is optimized for dense graphs. For large sparse graphs a more efficient algorithm should be used.<digraphThe empty graph on n nodes. This is the graph of % n and ' 0.=digraphUndirected clique.>digraph"The (irreflexive) singleton graph.?digraphUndirected pair.@digraphUndirected triangle.AdigraphDirected cycle.BdigraphUndirected cycle.CdigraphDirected line.DdigraphUndirected line.EdigraphThe Peterson graph. order: 10size: 30 degree: 3 diameter: 2FdigraphThe "twenty chain" graph. order: 20size: 60 degree: 3 diameter: 3GdigraphHoffman-Singleton Graph.–The Hoffman-Singleton graph is a 7-regular graph with 50 vertices and 175 edges. It's the largest graph of max-degree 7 and diameter 2. Cf. [https:/en.wikipedia.orgwiki/Hoffman“@Singleton_graph]()7 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI7#$ !"4/0132%'&(),*-+.589:;67<>=?@BADCEFGHI#Copyright © 2019 - 2020 Kadena LLC.MITLars Kuhtz  experimental Safe-InferredÜãï&WdigraphÓType of a random number generator that uniformily chooses an element from a range.Xdigraph-Undirected, irreflexive random regular graph.ÌThe algorithm here is incomplete. For a complete approach see for instance 8https://users.cecs.anu.edu.au/~bdm/papers/RandRegGen.pdfYdigraph-Undirected, irreflexive random regular graph.ÌThe algorithm here is incomplete. For a complete approach see for instance 8https://users.cecs.anu.edu.au/~bdm/papers/RandRegGen.pdf`digraphûUniformily sample an element from the input set. Returns the set with the sampled element removed and the sampled element.Zdigraph+Undirected irreflexive random graph in the G_{n,p} model.Ydigraph!a uniform random number generatorWXYZWXYZá      !"#$%&'()*+,-./012345678  9 :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_à$digraph-0.3.0-9z80tiPuBJDE2vNVRmdMieData.DiGraph.FloydWarshall Data.DiGraphData.DiGraph.RandomShortestPathMatrix AdjacencySetsDenseAdjMatrixfromAdjacencySetstoAdjacencySets floydWarshall shortestPathdistancediameter distMatrix_floydWarshall_shortestPaths_ diameter_$fShowShortestPathMatrix$fEqShortestPathMatrix$fOrdShortestPathMatrix$fGenericShortestPathMatrix$fNFDataShortestPathMatrixShortestPathCacheDiGraphDiEdge isDiGraph adjacencySetsverticesedges adjacents incidentsfromListunsafeFromList fromEdgesunion mapVertices transpose symmetric insertEdge insertVertexorderdiSizesizesymSize outDegree maxOutDegree minOutDegreeinDegree maxInDegree minInDegree isRegular isSymmetric isIrreflexiveisVertexisEdge isAdjacentshortestPathCache shortestPath_ distance_ emptyGraphclique singletonpairtrianglediCyclecyclediLineline petersonGraphtwentyChainGraphhoffmanSingletonpentagon ascendingCube$fMonoidDiGraph$fSemigroupDiGraph$fShowShortestPathCache$fEqShortestPathCache$fOrdShortestPathCache$fGenericShortestPathCache$fNFDataShortestPathCache $fShowDiGraph $fEqDiGraph $fOrdDiGraph$fGenericDiGraph$fNFDataDiGraph$fHashableDiGraph UniformRngrrgIOrrggnp intDistMatrixfloydWarshallInternal _spcMatrix _spcIndices _spcVertices uniformSample