xRa      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Inferred  Internal definitions(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.com Safe-Inferred.A relationship between two nodes with a label.Squaring a number.Shorthand for  Flip a pair.3Apply the same function to both elements of a pair.Create a lookup  to determine which  has a specific label.The node number of an .The label of an .HFind all the labelled nodes in the graph that match the given predicate.?Find all the nodes in the graph that match the given predicate. Obtain the labels for a list of s. It is assumed that each & is indeed present in the given graph. Obtain the labels for a  of s. It is assumed that each & is indeed present in the given graph.  Obtain the labels for a list of s. It is assumed that each & is indeed present in the given graph.  Obtain the labels for a list of s. It is assumed that each & is indeed present in the given graph.   Graphalyze Types and Classes(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone Specify the size the  should be at. (Let GraphViz choose an appropriate size. Specify the maximum size to use.&A specification on how to visualise a .EDefines the parameters used for creating visualisations of graphs.Root directory of the document.Image sub-directory.The default visualisation.If  vp'F, then a larger visualisation is linked to from the default one.,Should the Dot source code be saved as well? Specify the O to turn into an image, its filename (sans extension) and its caption. The  should not have a  set.>What name to provide the image file (without an extension).Inline elements of a document.'Elements of a document..@Representation of a location, either on the internet or locally.1,Represents the class of document generators.2Convert idealised 4F values into actual documents, returning the document file created.3The extension of all document-style files created. Note that this doesn't preclude the creation of other files, e.g. images.4PRepresentation of a document. The document is to be stored in the directory 60, and the main file is to have a filename of 7  (3 dg), where dg is an instance of 1.6Document location8The sub-directory of 6$, where graphs are to be created.9 Pre-matter< Main-matter><Create the legend section and add it to the document proper.?Return today's date as a string, e.g. "Monday 1 January, 2000". This arbitrary format is chosen as there doesn't seem to be a way of determining the correct format as per the user's locale settings.@5Attempts to create the specified directly, returning True8 if successful (or if the directory already exists), False if an error occurred.ArAttempts to create image files (with the given filename in the given directory) from the graph. If the second  not Q, then the first image links to the second. The whole result is wrapped in a ,. C& is applied to the filename in the .If & is true, then it is assumed that the  isn't ,  or  (because of filename clashes).YIf both output formats are the same, then the larger image needs a different filename.Add a GlobalAttribute to the  specifying the given size.B$Using a 6:4 ratio, create the given Point- representing width,height from the width.C Replace all . with - in the given B, since some output formats (e.g. LaTeX) don't like extraneous .'s in the filename.?  !"#$%&'()*+,-./0123456789:;<=>?@AVisualisation parameters.BC8  !"#$%&'()*+,-./0123456789:;<=>?@ABC8456789:;<=123.0/'-,+*)(&%$#"!  >?@ABC  &%$#"! '-,+*)(.0/1234 56789:;<=>?@ABCGraphalyze Types and Classes(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone,Used when traversing the document structure.DoDefinition of a Pandoc Document. Size measurements are in inches, and a 6:4 ratio is used for width:length. The Pandoc document style The file extension used Which template to get. Size of graphs to be produced. (Optional size of external linked graphs.,Should the Dot source code be saved as well?3Some default sizes. Note that all other fields of D still need to be defined.IFAlso save the generated Dot code to file when creating visualisations. Define the  used.Start with a level 1 heading.Create the document.The meta informationCHtml output doesn't show the author and date; use this to print it.Link conversion%Conversion of simple inline elements.Conversion of complex elements. The only reason it's in the IO monad is for GraphImage, as it requires IO to create the image.1If any one of the conversions fail (i.e. returns ), the entire process fails.In future, may extend this to creating multiple files for top-level sections, in which case the IO monad will be required for that as well.,Concatenate the result of multiple calls to .As for  , but don't concat the resulting s.D     EFGHI !"DEFGHIDEFGHID     EFGHI !"Graphalyze Types and Classes(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone234=KJOLabel type for storing node positions. Note that this isn't an instance of TW since there's no clear indication on which cluster a node belongs to at this stage.PA generic cluster-label type.T5These types and classes represent useful label types.sThe class of outputs of a clustering algorithm. This class is mainly used for visualization purposes, with the #q instance required for grouping. Instances of this class are intended for use as the label type of graphs.W&The cluster the node label belongs in.XThe actual label.YA grouping of s.ZA grouping of s.[5An alias for the type of graph being used by default.\6Represents information about the graph being analysed.^(We use a graph type with no edge labels._%The expected root nodes in the graph.`8Is the data this graph represents directed in nature?auUnused relationships (i.e. not in the actual graph). These are the edges containing nodes not in the graph.b.The expected roots in the data to be analysed.cKAdd extra expected root nodes. No checks are made that these are valid  values.d9Use a filtering function to find extra root nodes to add.e.Apply an algorithm to the data to be analysed.fSApply an algorithm that requires knowledge about whether the graph is directed ($) or undirected (% ) to the data to be analysed.gApply a function to all the data points. This might be useful in circumstances where you want to reduce the data type used to a simpler one, etc. The function is also applied to the datums in a.hfApply the first function to nodes in the graph, and the second function to those unknown datums in ac. As a sample reason for this function, it can be used to apply a two-part constructor (e.g. & and ' from (c) to the nodes such that the wanted and unwanted datums can be differentiated before calling i.i Merge the a3 into the graph by adding the appropriate nodes.j Used to set a = []. This is of use when they are unneeded or because there is no sensible mapping function to use when applying a mapping function to the nodes in the graph.kSReplace the current graph by applying a function to it. To ensure type safety, j is applied.lxReplace the current graph by applying a function to it, where the function depends on whether the graph is directed ($) or undirected (%). To ensure type safety, j is applied.%JKLMNOPQRSTUVWXYZ[\]^_`abcdefghi)jkl*'JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl'\]^_`a[ZYbcdefijklghTUVWXPQRSJKLMNOJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi)jkl*Utility functions(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone m"The labels of all nodes in a tree.n Extract the + from the ,.oThe label of an ,.pExtract the actual  s from an -.q{Make the graph undirected, i.e. for every edge from A to B, there exists an edge from B to A. The provided function  K duplicates loops as well, which isn't wanted. It is assumed that no edges are already duplicates [i.e. if there exists an edge (n1,n2), then there doesn't exist (n2,n1)]. This function also preserves edge labels: if two edges exist between two nodes with different edge labels, then both edges will be duplicated.rThis is a pseudo-inverse of qS: any edges that are both successor and predecessor become successor edges only.sMakes the graph a simple one, by removing all duplicate edges and loops. The edges removed if duplicates exist are arbitrary.t7Adjoin duplicate edges by grouping the labels together.uwCompact the graph by counting how many multiple edges there are (considering only the two nodes and not the labels).v9Compact the graph by adjoining identical duplicate edges.w@Map over the labels on the nodes, using the node values as well.x+Delete these labelled nodes from the graph.yMConvert the graph into one with positions stored in the node labels. The .6 parameter denotes if the graph is directed or not.zRReturns the positions of the nodes in the graph, as found using Graphviz. The .6 parameter denotes if the graph is directed or not.{Create a cluster-lookup /.|0Used when the clusters are assigned in a lookup / instance.}hChange the cluster values in the graph by having the largest cluster have the smallest cluster label.~1Change the cluster values using the given lookup /. Create an / of the size of each cluster.>Return true if and only if the list contains a single element.7If we need to only tell if the list contains more than n1 elements, there's no need to find its length.Add the length of each sublist.,Returns the longest list in a list of lists..Group elements by the given grouping function.kReturns the unique elements of the list in ascending order, as well as the minimum and maximum elements.|Shuffle a list of elements. This isn't the most efficient version, but should serve for small lists. Adapted from:  0http://www.cse.unsw.edu.au/~tsewell/shuffle.htmle The adaptation mainly involved altering the code so that the new random seed is also returned.>An efficient mean function by Don Stewart, available from: 5http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast@Calculate the mean and standard deviation of a list of elements.7Calculate the mean and standard deviation of a list of 0 values.@Find the fixed point of a function with the given initial value.fFind the fixed point of a function with the given initial value, using the given equality function.8Find the fixed point of a graph transformation function.#mnopqrstuvwxyz{|}~12(Mean, Standard Deviation)(Mean, Standard Deviation)) mnopqrstuvwxyz{|}~)mno pqrstuvwxyz{|}~#mnopqrstuvwxyz{|}~12Graphviz wrapper functions(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone Convert the \ into  format.Convert the clustered \ into / format. Cluster the nodes based upon their T clusters.A function to convert an  to the required 3& for use with the GraphViz library.A cross between f and 4.-Print a path, with "->" between each element.-Print a path, with "->" between each element.OPrint a cycle: copies the first node to the end of the list, and then calls .OPrint a cycle: copies the first node to the end of the list, and then calls .1Show a group of nodes, with no implicit ordering.1Show a group of nodes, with no implicit ordering.Attempt to convert the Stringn form of a list into as much of a square shape as possible, using a single space as a separation string.Attempt to convert a list of Strings into a single StringN that is roughly a square shape, with a single space as a row separator.Attempt to convert the String` form of a list into as much of a square shape as possible, separating values with commas.Attempt to combine a list of StringOs into as much of a square shape as possible, separating values with commas.Attempt to convert the String form of a list into as much of a square shape as possible, using the given separation string between elements in the same row.2Attempt to convert the combined form of a list of Stringws into as much of a square shape as possible, using the given separation string between elements in the same row.5UUsing the given line length and allowed error, take the elements of the next line.6ARecursively build the rest of the line with given maximum length.5656Algorithms for all graph types.(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone)Find all connected components of a graph.78Find the next component and split it off from the graph.8WExtract the given node and all nodes it is transitively connected to from the graph.9Helper function for 8 above.MFind all possible paths from this given node, avoiding loops, cycles, etc.:Remove all outgoing edgesGFinds all cliques (i.e. maximal complete subgraphs) in the given graph.9Finds all cliques in the graph, without including labels.;cDetermine if the given list of nodes is indeed a clique, and not a smaller subgraph of a clique..Find all regular subgraphs of the given graph.<-Extract the next regular subgraph of a graph.=:Returns all regular subgraphs that include the given node.>RRecursively find all regular subgraphs only containing nodes in the given list.?rReturn all nodes that are co-recursive with the given node (i.e. for n, find all n' such that n->n' and n'->n).>Determines if the list of nodes represents a regular subgraph.#Find all cycles in the given graph.=Find all cycles in the given graph, returning just the nodes.JFind all cycles in the given graph, excluding those that are also cliques.JFind all cycles in the given graph, excluding those that are also cliques.@)Find all cycles containing a chosen node.A#Find all cycles for the given node.#Find all chains in the given graph.#Find all chains in the given graph.B'Find the chain starting with the given .C Find the next link in the chain.D5Determines if the given node is the start of a chain.EDetermine if the given node matches the chain criteria in the given direction, and if so what the next node in that direction is.F Find the next node in the chain.GBDetermines if this node matches the successor criteria for chains.HDDetermines if this node matches the predecessor criteria for chains.789:;<=>?@ABCDEFGH 789:;<=>?@ABCDEFGHAlgorithms for directed graphs.(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone Determine if this  is an ending node.Determine if this  is an ending node. Find all  s that meet the ending criteria. Find all !s that match the ending criteria.Find all roots of the graph.Find all roots of the graph.Returns True if this  is a root.Returns True if this  is a root.Find all leaves of the graph.Find all leaves of the graph.Returns True if this  is a leaf.Returns True if this  is a leaf.!Find all singletons of the graph.!Find all singletons of the graph.Returns True if this  is a singleton.Returns True if this  is a singleton.The core of the graph is the part of the graph containing all the cycles, etc. Depending on the context, it could be interpreted as the part of the graph where all the "work" is done.}Cluster the nodes in the graph based upon how far away they are from a root node. Root nodes are in the cluster labelled , nodes in level "n" (with  n > minLevel) are at least n edges away from a root node.As with " but provide a custom grouping of  s to consider as the "roots".The level of the nodes in the Z provided to  (or the root nodes for H). A level less than this indicates that the node is not accessible.IObtain the levels in the graph.JThe  (NSet, g a b)N parameters are the current nodes to be starting with in the current graph.The shortest paths to each of the leaves in the graph (excluding singletons). This can be used to obtain an indication of the overall height/depth of the graph.The shortest paths to each of the leaves in the graph (excluding singletons). This can be used to obtain an indication of the overall height/depth of the graph.KSGiven the list of roots in this graph, find the shortest path to this leaf node. Find all (s that can be reached from the provided s. Find all 7s that can be reached from the provided nodes using s rather than lists. Find those /s that are reachable only from the provided s. Find those /s that are reachable only from the provided  s, using s rather than lists.LPseudo-inverse of M.N;Removing nodes which have predecessors outside of this Map.O6Are these predecessor nodes all found within this Map?"PIQJKLNO"PIQJKLNO#Clustering and grouping algorithms.(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone=A collapsed node contains a list of nodes that it represents.&The actual Chinese Whispers algorithm.R#Choose a new cluster for the given O. Note that this updates the graph each time a new cluster value is chosen.S#Choose a new cluster for the given Context.TChoose which cluster to pick by taking the one with maximum number of nodes. If more than one has the same maximum, choose one randomly.UJConvert the graph into a form suitable for the Chinese Whispers algorithm.oThe renamed CLUSTER algorithm. Attempts to cluster a graph by using the spatial locations used by Graphviz.V The Euclidian distance function.W+Converts the positional labels into an RNG.XDetermines if the two given nodes should be connected in the RNG. Nodes are connected if there is no node that is closer to both of them.Y4Performs the actual clustering algorithm on the RNG.Collapse the cliques, cycles and chains in the graph down. Note that this doesn't work too well on undirected graphs, since every pair of nodes forms a K_2 subgraph.=Use the given functions to determine which nodes to collapse.sUse the given functions to determine which nodes to collapse, with a new label to represent the collapsed nodes.As with , but also return the (Z, a)*'s calculated with the functions provided.ZCollapse the graph.Return ${ if the collapsed graph is either a singleton node or else isomorphic to the original graph (i.e. not collapsed at all).[ Allow the graph to be collapsed.\+Collapse the two given nodes into one node.],Collapse the list of nodes down to one node.^,Replace the label of the provided node with [a]._+Collapse all results of the given function.`XWe take the ceiling of the Euclidian distance function to use as our metric function.RSTUVWXYZ[a\]b^_`RSTUVWXYZ[a\]b^_`Graph analysis algorithms(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNone. #A Graph-Theoretic Analysis Library.(c) Ivan Lazar Miljenovic 2009 2-Clause BSDIvan.Miljenovic@gmail.comNoneThis represents the information that's being passed in that we want to analyse. If the graph is undirected, it is better to list each edge once rather than both directions.The discrete points.%The relationships between the points.'The expected roots of the graph. If  = %, then this is ignored.%> if relationships are symmetric (i.e. an undirected graph).The library version.FImport data into a format suitable for analysis. This function is  edge-safe.: if any datums are listed in the edges of e that aren't listed in the data points, then those edges are ignored. Thus, no sanitation of the  in  ImportParams6 is necessary. The unused relations are stored in a1. Note that it is assumed that all datums in  are also contained within .Returns the mean and standard deviations of the lengths of the sublists, as well all those lists more than one standard deviation longer than the mean.UCompare the actual roots in the graph with those that are expected (i.e. those in _). Returns (in order):0Those roots that are expected (i.e. elements of _ that are roots).EThose roots that are expected but not present (i.e. elements of _ that aren't roots.?Unexpected roots (i.e. those roots that aren't present in _).PFind the nodes that are not reachable from the expected roots (i.e. those in _).Only return those chains (see %) where the non-initial nodes are not expected roots.As with , but also update the _~ to contain the possibly compressed nodes. Since the datums they refer to may no longer exist (as they are compressed), a is set to [].As with , but also includes a lookup " from the old label to the new.As with =, but use the expected roots rather than the actual roots.5cdefghijklmnopqrstuvwxyz{|}~+,-  !"#$%&'()*+,-./0123456789:;<=>?@ABCJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmmnopqrstuvwxyz{|}~             !"#$%&'()*+,-./0123456789:;<=>?@ABCDECFGCFHIJIKILMNOPQCFRSTCFUVWXYXZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Graphalyze-0.14.1.1Data.Graph.Analysis.TypesData.Graph.Analysis.UtilsData.Graph.Analysis.Reporting$Data.Graph.Analysis.Reporting.Pandoc!Data.Graph.Analysis.Visualisation%Data.Graph.Analysis.Algorithms.Common'Data.Graph.Analysis.Algorithms.Directed)Data.Graph.Analysis.Algorithms.ClusteringData.Graph.AnalysisPaths_GraphalyzeData.Graph.Analysis.InternalData.Graph.Inductive.BasicundirData.Graph.Analysis.Algorithmsgraphviz-2999.18.0.0#Data.GraphViz.Types.Internal.CommonStrNumGraphIDRelnodelabel filterNodes filterNodes' addLabels addLabels' getLabels getLabels' GraphSize DefaultSize GivenSize VisPropertiesVPropssizeformat VisParamsVParamsrootDirgraphDir defaultImage largeImagesaveDotDocGraphDG imageFile descriptiondotGraph DocInlineDocImageDocLinkEmphasisBoldGrouping BlankSpaceText DocElement GraphImage DefinitionsItemized Enumeration ParagraphSectionLocationFileWebDocumentGeneratorcreateDocument docExtensionDocumentDoc rootDirectory fileFrontgraphDirectorytitleauthordatelegendcontent addLegendtodaytryCreateDirectory createGraph createSize unDotPathPandocDocument pandocHtml pandocLaTeX pandocRtfpandocMarkdown alsoSaveDotPosLabelPLabelxPosyPospnodeplabel GenClusterGCclustnLbl ClusterLabelCluster NodeLabelcluster nodeLabelLNGroupNGroupAGr GraphDatagraphwantedRootNodes directedDataunusedRelationships wantedRootsaddRoots addRootsByapplyAlg applyDirAlg mapAllNodes mapNodeType mergeUnused removeUnused updateGraph updateGraph'labelsedgeeLabel pathValuesoneWaymkSimplecompactcompact' compactSamenlmap delLNodes toPosGraph getPositions createLookup setCluster reCluster reClusterBy clusterCountsingle longerThan addLengthslongest lengthSort groupElems sortMinMaxshufflemean statistics statistics'fixPoint fixPointByfixPointGraphsgraphvizgraphvizClusters assignClustersetDirshowPath showPath' showCycle showCycle' showNodes showNodes' blockPrint blockPrint'blockPrintListblockPrintList'blockPrintWithblockPrintWith' componentsOfpathTree cliquesIn cliquesIn' findRegular isRegularcyclesIn cyclesIn' uniqueCycles uniqueCycles'chainsIn chainsIn'endNodeendNode'endByendBy'rootsOfrootsOf'isRootisRoot'leavesOf leavesOf'isLeafisLeaf' singletonsOf singletonsOf' isSingleton isSingleton'coreOf levelGraphlevelGraphFromminLevel leafMinPaths leafMinPaths'accessibleFromaccessibleFrom'accessibleOnlyFromaccessibleOnlyFrom'CNodeschineseWhispersrelativeNeighbourhood collapseGraphcollapseGraphBycollapseAndReplacecollapseAndReplace'trivialCollapse ImportParams ImpParams dataPoints relationshipsrootsdirectedversion importDatalengthAnalysis classifyRootsinaccessibleNodesinteriorChainscollapseAndUpdatecollapseAndUpdate'levelGraphFromRootcatchIObindirlibdirdatadir libexecdir sysconfdir getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamesqfIbaseGHC.Real fromIntegralswap applyBoth mkNodeMapcontainers-0.5.5.1 Data.Map.BaseMap fgl-5.5.2.1Data.Graph.Inductive.GraphNodeLNode Data.Set.BaseSet spreadOut applyNodesfromNodetoNoderelLabelrelsToEsData.GraphViz.Types.CanonicalDotGraph Data.MaybeJust!Data.GraphViz.Attributes.CompleteSizefilepath-1.3.0.2System.FilePath.Posix<.>NothingData.GraphViz.CommandsCanon DotOutputXDotcheckLargeFilenamesetSizeGHC.IOFilePathlegendToElementlegToDef checkFilename graphImage graphImage' PandocProcesswriter extension templateName graphProps extGraphPropskeepDotpd writerOptionspandoc-1.15.0.6Text.Pandoc.Options WriterOptionsdefaultProcess createPandocmakeMetahtmlInfo loc2targetinlineselements multiElems multiElems'pandoc-types-1.12.4.5Text.Pandoc.DefinitionBlockPPsecLevel visParamsPD defaultWidth defaultProps!$fDocumentGeneratorPandocDocumentghc-prim GHC.ClassesOrd GHC.TypesTrueFalse Data.EitherLeftRightEither knownNodes$fClusterLabelGenClusterEdgeLEdgeLPathBoolData.IntMap.BaseIntMapInt splitAndCount randomMerge Data.GraphViz LNodeClustersetDirectednesstakeLentakeLinesplitComponent extractNode nodeExtractormakeLeafisClique findRegularOf regularOf alsoRegulartwoCycle findCycles cyclesForgetChain chainLink isChainStart chainFind chainNexthasNexthasPrev graphLevels getNextLevellfMinPthsetKeyskeysSetkeepOnlyInternalonlyInternalPredNSet graphLevels' whisperNodewhisper chooseWhisper addWhispers euclidianmakeRNG areRelative nbrCluster collapseGrmakeCollapsiblecollapse collapseAll adjustLabel collapseAllBy$fMetricPosLabel unCollapsemaybeAdjustLabel prettyPrintprettifyequalhasNeighborAdjhasLEdge hasNeighborhasEdgedeg'indeg'outdeg'inn'out'lpre'lsuc'pre'suc' lneighbors' neighbors'labNode'lab'node'degindegoutdeginnoutlprelsucpresuc lneighbors neighborslabcontextsubgraph labfilternfilter labnfilter gfiltermapmkUGraphbuildGrdelEdgesdelNodesinsEdgesinsNodes delAllLEdgedelLEdgedelEdgedelNodeinsEdgeinsNodegelemnewNodes edgeLabeltoLEdgetoEdgeedgesnodesnemapemapnmapgmapufoldUNodeUEdgePathunLPathLPUPathAdjContextMContextDecompGDecompUContextUDecomplabEdges nodeRangenoNodesmatchAnylabNodesmkGraphmatchisEmptyemptyGraph&DynGraphunOrdGrOrdGr