úÎ!ÝÑÕ¹      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª« ¬ ­ ® ¯ ° ± ² ³ ´ µ ¶ · ¸ Safe øgraphiteThe Degree Sequence of a DGraph) is a list of pairs (Indegree, Outdegree)Safe7=?XUì@graphite%Edge attributes that represent labelsgraphite&Edge attributes that represent weights graphite$Directed Arc with attribute of type e between to Vertices of type v graphite'Undirected Edge with attribute of type e between to Vertices of type vgraphiteTypes that represent edges The main  instances are   for undirected edges and   for directed edges.graphite&Retrieve the origin vertex of the edgegraphite+Retrieve the destination vertex of the edgegraphite"Retrieve the attribute of the edgegraphite2Convert an edge to a pair discarding its attributegraphite7Convert a pair to an edge, where it's attribute is unitgraphiteKConvert an edge to a triple, where the 3rd element it's the edge attributegraphiteConvert a triple to an edgegraphiteTell if an edge is a loopAn edge forms a loop- if both of its ends point to the same vertexgraphiteTypes that behave like graphs The main  instances are UGraph and DGraphŽ. The functions in this class should be used for algorithms that are graph-directionality agnostic, otherwise use the more specific ones in UGraph and DGraphgraphite:The Empty (order-zero) graph with no vertices and no edgesgraphiteRetrieve the order of a graphThe order% of a graph is its number of verticesgraphiteRetrieve the size of a graphThe size" of a graph is its number of edgesgraphiteDensity of a graphThe densityX of a graph is the ratio of the number of existing edges to the number of posible edgesgraphite$Retrieve all the vertices of a graphgraphiteRetrieve the edges of a graphgraphite6Retrieve the edges of a graph, ignoring its attributesgraphite$Tell if a vertex exists in the graph graphite!Tell if two vertices are adjacent!graphite*Retrieve the adjacent vertices of a vertex"graphiteSame as !$ but gives back the connecting edges#graphiteSame as !c but gives back only those vertices for which the connecting edge allows the vertex to be reached..For an undirected graph this is equivalent to !u, but for the case of a directed graph, the directed arcs will constrain the reachability of the adjacent vertices.$graphiteSame as #$ but gives back the connecting edges%graphite*Total number of incident edges of a vertex&graphite(Degrees of a all the vertices in a graph'graphiteMaximum degree of a graph(graphiteMinimum degree of a graph)graphiteAverage degree of a graph*graphiteZInsert a vertex into a graph. If the graph already contains the vertex leave it untouched+graphiteoInsert many vertices into a graph. New vertices are inserted and already contained vertices are left untouched,graphite#Tell if an edge exists in the graph-graphite'Retrieve the incident edges of a vertex.graphite@Retrieve the incident edges of a vertex, ignoring its attributes/graphite-Get the edge between to vertices if it exists0graphite”Insert an edge into a graph. The involved vertices are inserted if don't exist. If the graph already contains the edge, its attribute gets updated1graphiteSame as 0 but for multiple edges2graphiteSame as 0; but insert edge pairs in graphs with attribute less edges3graphiteSame as 2 for multiple edges4graphite^Remove a vertex from a graph if present. Every edge incident to this vertex also gets removed5graphiteSame as 4 but for multiple vertices6graphiteQRemove an edge from a graph if present. The involved vertices are left untouched7graphiteSame as 6 but for multiple edges8graphitePRemove the edge from a graph if present. The involved vertices also get removed9graphite1Retrieve the isolated vertices of a graph, if any:graphiteTell if a graph is simple A graph is simple if it has no loops;graphiteUnion of two graphs<graphiteIntersection of two graphs=graphite;Convert a graph to an adjacency list with vertices in type v and edge attributes in e>graphiteZConstruct a graph from an adjacency list with vertices in type /v and edge attributes in e?graphite`Get the adjacency binary matrix representation of a graph toAdjacencyMatrix :: g v e -> [[Int]]GGenerate a graph of Int vertices from an adjacency square binary matrix@graphite'Construct an attribute less undirected   between two verticesAgraphite%Construct an attribute less directed   between two vertices¹graphiteEdges generatorBgraphite8Convert a triple to a pair by ignoring the third elementCgraphite8Convert a pair to a triple where the 3rd element is unitDgraphite)Get the origin vertex from an edge tripleEgraphite.Get the destination vertex from an edge tripleFgraphite%Get the attribute from an edge tripleGgraphiteTwo  Ls are equal if they point to the same vertices, regardless of the directionLgraphiteTwo  Ps are equal if they point to the same vertices, and the directions are the sameA >=;<: ,!"#$%&'()*+-./0123456789?@ABCDEFA>=;<: ,!"#$%&'()*+-./0123456789? @A BCDEFSafeZZ_graphite<breadh-first-search vertices starting at a particular vertex`graphite;depth-first-search vertices starting at a particular vertex_`_`NoneX^agraphite/Read a graph from a CSV file of adjacency listsThe CSV lines: "1,2,3,4" "2,1,4,5"/produce the graph with this list of edge pairs: 0[(1, 2), (1, 3), (1, 4), (2, 1), (2, 4), (2, 5)]bgraphiteSame as a) but rise an exception when parsing failsabab SafegvºgraphiteEach vertex maps to a º' value so it can poit to other vertices»graphitepInsert a link directed to *v* with attribute *a* | If the connnection already exists, the attribute is replaced¼graphite Get the links for a given vertex½graphiteGet  6s from an association list of vertices and their links¾graphiteGet  6s from an association list of vertices and their links¿graphitežO(log n) Associate the specified value with the specified key in this map. | If this map previously contained a mapping for the key, leave the map | intact.º»¼½¾¿Safe%7=XuÓ cgraphite Undirected Graph of Vertices in v and Edges with attributes in edgraphiteInsert an undirected   into a c{The involved vertices are inserted if they don't exist. If the graph already contains the Edge, its attribute gets updatedegraphiteSame as d but for a list of  sfgraphiteRemove the undirected   from a c6 if present. The involved vertices are left untouchedggraphiteSame as f but for a list of  shgraphiteRemove the undirected   from a c4 if present. The involved vertices also get removedigraphite Retrieve the  s of a cjgraphiteTell if an undirected   exists in the graphkgraphiteRetrieve the incident   s of a Vertexlgraphite Convert a c to a list of  s discarding isolated verticesNote that because lA discards isolated vertices: > fromEdgesList . toEdgesList /= idmgraphite Construct a c from a list of  sngraphitePretty print a c cdefghijklmn cdefghijklmnSafe7Xœ)zgraphiteDirected Graph of Vertices in v and Arcs with attributes in e{graphiteInsert a directed   into a zzThe involved vertices are inserted if they don't exist. If the graph already contains the Arc, its attribute gets updated|graphiteSame as { but for a list of  s}graphiteRemove the directed   from a z6 if present. The involved vertices are left untouched~graphiteSame as } but for a list of  sgraphiteRemove the directed   from a z4 if present. The involved vertices also get removed€graphite Retrieve the  s of a zgraphiteTell if a directed   exists in the graph‚graphiteRetrieve the inbounding   s of a VertexƒgraphiteRetrieve the outbounding   s of a Vertex„graphiteRetrieve the incident   s of a VertexThe incidentL arcs of a vertex are all the inbounding and outbounding arcs of the vertex…graphiteIndegree of a vertexThe indegree) of a vertex is the number of inbounding   s to a vertex†graphiteOutdegree of a vertexThe  outdegree* of a vertex is the number of outbounding  s from a vertex‡graphite#Indegrees of all the vertices in a zˆgraphite#Outdegree of all the vertices in a zÀgraphite Tell if a z is symmetricA directed graph is  symmetric if all of its  s are bi-directedÁgraphite Tell if a z is orientedA directed graph is oriented if there are none bi-directed  sNote: This is not the opposite of À‰graphite Tell if a z is balancedA directed graph is balanced when its indegree = outdegreeÂgraphite Tell if a z is regularA directed graph is regularE when all of its vertices have the same number of adjacent vertices AND when the indegree and  outdegree) of each vertex are equal to each other.ŠgraphiteTell if a vertex is a sourceA vertex is a source when its  indegree = 0‹graphiteTell if a vertex is a sinkA vertex is a sink when its  outdegree = 0ŒgraphiteTell if a vertex is internal A vertex is internal when its neither a source nor a sinkgraphiteGet the transpose of a zThe  transposeR of a directed graph is another directed graph where all of its arcs are reversedŽgraphiteConvert a directed z to an undirected UGraph by converting all of its  s into  sgraphite Convert a z to a list of  s discarding isolated verticesNote that because  discards isolated vertices: fromArcsList . toArcsList /= idgraphite Construct a z from a list of  s‘graphitePretty print a zz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘z{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘ Safe¢9ÃgraphitecTell if two graphs are isomorphic TODO: check first: same number of vertices, same number of edgesÄgraphite Tell if a c is regularAn undirected graph is regular# if each vertex has the same degreeÅgraphite Tell if a z is regularA directed graph is regular4 if each vertex has the same indegree and outdegreeSafeX¬graphite1Generate a random ErdQs Rényi G(n, p) model graphžgraphite convinience c generation functionŸgraphite convinience z generation function graphite5Generate a random graph for all the vertices of type v) in the list, random edge attributes in eh within given bounds, and some existing probability for each possible edge as per the ErdQs Rényi model¡graphiteSame as   but uses attributeless edges¢graphite"Generate a random adjacency matrixUseful for use with ?Ægraphite:Insert and edge between vertices if the probability is metÇgraphite2Bound a real value as probability value [0.0, 1.0]žŸ ¡¢žŸ ¡¢SafeX½¦£graphite-Tell if two vertices of a graph are connectedTwo vertices are  connectedd if it exists a path between them. The order of the vertices is relevant when the graph is directed¤graphite Opposite of £¥graphiteTell if a vertex is isolated A vertex is isolated? if it has no incident edges, that is, it has a degree of zero¦graphiteTell if a graph is connectedAn undirected graph is  connectedR when there is a path between every pair of vertices FIXME: Use a O(n) algorithm§graphiteTell if a graph is bridgeless A graph is  bridgelessp if it has no edges that, when removed, split the graph in two isolated components FIXME: Use a O(n) algorithm¨graphite Tell if a c is orientableAn undirected graph is  orientable7 if it can be converted into a directed graph that is strongly connected (See ª)©graphite Tell if a z is weakly connectedA directed graph is weakly connected( if the underlying undirected graph is  connectedªgraphite Tell if a z is strongly connectedA directed graph is strongly connected: if it contains a directed path on every pair of vertices£¤¥¦§¨©ª£¤¥¦§¨©ª SafeËÜ«graphite The Degree Sequence of a simple c3 is a list of degrees of the vertices in the graphUse ¬% to construct a valid Degree Sequence¬graphite Construct a «> from a list of degrees. Negative degree values get discarded­graphiteGet the « of a simple c. If the graph is not simple (see :) the result is Nothing®graphite Tell if a « is a Graphical SequenceA Degree Sequence is a Graphical Sequence if a corresponding c0 for it exists. Uses the Havel-Hakimi algorithmÈgraphite Tell if a « is a Directed GraphicA Directed Graphic" is a Degree Sequence for which a DGraphG exists TODO: Kleitman Wang | Fulkerson Chen Anstee theorem algorithms¯graphite Tell if a «Y holds the Handshaking lemma, that is, if the number of vertices with odd degree is evenÉgraphiteGet the corresponding c of a « . If the « is not graphical (see ®) the result is Nothing«¬­®¯«¬­®¯ NoneÑ¡³graphitePlot an undirected c´graphiteSame as ³ but render edge attributesµgraphitePlot an undirected c to a PNG image file¶graphitePlot a directed z·graphiteSame as ¶ but render edge attributes¸graphitePlot a directed z to a PNG image fileÊgraphite Label edgesËgraphite Label edgesÌgraphiteDirectedgraphite Label edges³´µ¶·¸³¶´·µ¸Í   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™šx›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³  ´ µ ¶ ·    ¸ ¹ º » ¼ ½¾ ¿ À Á  à ÄÅÆÇ È É ÊËÌ Í Î Ï Ð ÑÒ(graphite-0.10.0.1-HhXsvYnwz7AHqOTrhvfKfJ Data.Graph.DGraph.DegreeSequenceData.Graph.TypesData.Graph.TraversalData.Graph.ReadData.Graph.UGraphData.Graph.DGraphData.Graph.GenerationData.Graph.Connectivity Data.Graph.UGraph.DegreeSequenceData.Graph.VisualizeData.Graph.InternalData.Graph.MorphismsDegreeSequenceunDegreeSequence$fEqDegreeSequence$fOrdDegreeSequence$fShowDegreeSequenceLabeledlabelWeightedweightArcEdgeIsEdge originVertexdestinationVertex attributetoPairfromPairtoTriple fromTripleisLoopGraphemptyordersizedensityvertices edgeTriples edgePairscontainsVertex areAdjacentadjacentVerticesadjacentVertices'reachableAdjacentVerticesreachableAdjacentVertices' vertexDegreedegrees maxDegree minDegree avgDegree insertVertexinsertVerticescontainsEdgePairincidentEdgeTriplesincidentEdgePairs edgeTripleinsertEdgeTripleinsertEdgeTriplesinsertEdgePairinsertEdgePairs removeVertexremoveVerticesremoveEdgePairremoveEdgePairsremoveEdgePairAndVerticesisolatedVerticesisSimpleunion intersectiontoListfromListfromAdjacencyMatrix<->--> tripleToPair pairToTripletripleOriginVertextripleDestVertextripleAttribute$fEqEdge $fFunctorEdge$fArbitraryEdge $fIsEdgeEdge $fNFDataEdge$fEqArc $fFunctorArc$fArbitraryArc $fIsEdgeArc $fNFDataArc $fWeighted(,)$fWeightedDouble$fWeightedFloat $fWeightedInt $fLabeled(,) $fLabeled[] $fShowEdge $fReadEdge $fOrdEdge $fGenericEdge $fShowArc $fReadArc$fOrdArc $fGenericArc bfsVertices dfsVerticesfromCsvfromCsv'UGraph insertEdge insertEdges removeEdge removeEdgesremoveEdgeAndVerticesedges containsEdge incidentEdges toEdgesList fromEdgesList prettyPrint $fGraphUGraph$fArbitraryUGraph$fNFDataUGraph$fFoldableUGraph$fFunctorUGraph$fSemigroupUGraph$fMonoidUGraph $fReadUGraph $fShowUGraph $fEqUGraph$fGenericUGraphDGraph insertArc insertArcs removeArc removeArcsremoveArcAndVerticesarcs containsArcinboundingArcsoutboundingArcs incidentArcsvertexIndegreevertexOutdegree indegrees outdegrees isBalancedisSourceisSink isInternal transpose toUndirected toArcsList fromArcsList$fArbitraryDGraph $fGraphDGraph$fNFDataDGraph$fFoldableDGraph$fFunctorDGraph$fSemigroupDGraph$fMonoidDGraph $fReadDGraph $fShowDGraph $fEqDGraph$fGenericDGraph erdosRenyi erdosRenyiU erdosRenyiDrndGraph rndGraph'rndAdjacencyMatrix areConnectedareDisconnected isIsolated isConnected isBridgeless isOrientableisWeaklyConnectedisStronglyConnecteddegreeSequencegetDegreeSequenceisGraphicalSequenceholdsHandshakingLemma plotUGraphplotUGraphEdged plotUGraphPng plotDGraphplotDGraphEdged plotDGraphPng arbitraryEdgeLinks insertLinkgetLinks linksToArcs linksToEdges hashMapInsert isSymmetric isOriented isRegular areIsomorphic isURegular isDRegularinsertFlippedEdge probabilityisDirectedGraphicfromGraphicalSequencetoUndirectedDot toDirectedDotsensibleDotParams