A/}      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Internal definitions Ivan.Miljenovic@gmail.com/A relationship between two nodes with a label. Squaring a number. Shorthand for    Flip a pair. 4Apply the same function to both elements of a pair.  Obtain the labels for a list of s.  It is assumed that each ' is indeed present in the given graph.  Graphalyze Types and Classes Ivan.Miljenovic@gmail.comSpecify the size the  should be at. )Let GraphViz choose an appropriate size. Specify the size to use.  Specify the + to turn into an image, its filename (sans $ extension) and its caption. The  should not have a   set. Inline elements of a document. Elements of a document. ARepresentation of a location, either on the internet or locally. -Represents the class of document generators. Convert idealised  values into actual documents, ( returning the document file created. >The extension of all document-style files created. Note that  this doesn'5t preclude the creation of other files, e.g. images. ?Representation of a document. The document is to be stored in  the directory !, and the main file is to have a  filename of   ( dg), where dg is an  instance of . Document location The sub-directory of , # where graphs are to be created.  Pre-matter # Main-matter $ Return today's date as a string, e.g. "Monday 1 January, 2000". 1 This arbitrary format is chosen as there doesn't seem to be a way 4 of determining the correct format as per the user's locale settings. %5Attempts to create the specified directly, returning True 7 if successful (or if the directory already exists), False  if an error occurred. &?Attempts to creates a png file (with the given filename in the ? given directory) from the graph using the given attributes. * If the second set of attributes is not  , then the first @ image links to the second. The whole result is wrapped in a  . Create the inline image/link from the given DocGraph. Add a GlobalAttribute to the  specifying the given size. '$Using a 6:4 ratio, create the given  representing  width,height from the width. ( Replace all . with - in the given  , since some output  formats (e.g. LaTeX) don't like extraneous .'s in the filename. '  !"#$%&'(' !"# $%&'('   !"# !"#$%&'(Graphalyze Types and Classes Ivan.Miljenovic@gmail.com-Used when traversing the document structure. )CDefinition 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 The Pandoc header to use Size of graphs to be produced. )Optional size of external linked graphs. 3Some default sizes. Note that all other fields of )  still need to be defined.  Define the  used. Start with a level 1 heading. Create the document. The meta information Html output doesn'2t show the author and date; use this to print it. Link conversion &Conversion of simple inline elements. 3Conversion 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. DIn future, may extend this to creating multiple files for top-level E 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. )*+,-)*+,-)*+,-Graphalyze Types and Classes Ivan.Miljenovic@gmail.com.:Label type for storing node positions. Note that this isn't an  instance of : since there's no clear indication on 2 which cluster a node belongs to at this stage. 4A generic cluster-label type. 8;A class used to define which types are valid for clusters. 9<Create a label for visualisation purposes with the GraphViz  library. Default is    . :6These types and classes represent useful label types. ?The class of outputs of a clustering algorithm. This class is 4 mainly used for visualization purposes, with the   instance D required for grouping. Instances of this class are intended for $ use as the label type of graphs. ='The cluster the node label belongs in. >The actual label. ?A grouping of s. @A grouping of s. A6An alias for the type of graph being used by default. B7Represents information about the graph being analysed. D)We use a graph type with no edge labels. E&The expected root nodes in the graph. F"Is the data this graph represents  directed in nature? G"Unused relationships (i.e. not in % the actual graph). These are the % edges containing nodes not in the  graph. H/The expected roots in the data to be analysed. I/Apply an algorithm to the data to be analysed. J=Apply an algorithm that requires knowledge about whether the  graph is directed () or undirected () to the data to  be analysed. K)Apply a function to all the data points. B This might be useful in circumstances where you want to reduce C the data type used to a simpler one, etc. The function is also  applied to the datums in G. L?Apply the first function to nodes in the graph, and the second ' function to those unknown datums in G. C As a sample reason for this function, it can be used to apply a  two-part constructor (e.g.   and   from  ) to = the nodes such that the wanted and unwanted datums can be ! differentiated before calling M. M Merge the G into the graph by adding the  appropriate nodes. N Used to set G = []. This is of use when = they are unneeded or because there is no sensible mapping D function to use when applying a mapping function to the nodes in  the graph. O<Replace the current graph by applying a function to it. To  ensure type safety, N is applied. PBReplace the current graph by applying a function to it, where the 6 function depends on whether the graph is directed () or  undirected (). To ensure type safety, N is  applied. )./0123456789:;<=>?@ABCDEFGHIJKLMNOP$BCDEFGA@?HIJMNOPKL:;<=>894567./0123#./0123/01234567567899:;<=>;<=>?@ABCDEFGCDEFGHIJKLMNOPUtility functions Ivan.Miljenovic@gmail.com$QThe node number of an . RThe label of an . S#The labels of all nodes in a tree. T Extract the  from the . UThe label of an . VIFind all the labelled nodes in the graph that match the given predicate. W@Find all the nodes in the graph that match the given predicate. XExtract the actual  s from an . YBMake the graph undirected, i.e. for every edge from A to B, there 6 exists an edge from B to A. The provided function   Data.Graph.Inductive.Basic.undir! 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 G exist between two nodes with different edge labels, then both edges  will be duplicated. ZThis is a pseudo-inverse of Y$: any edges that are both successor 0 and predecessor become successor edges only. [IMakes the graph a simple one, by removing all duplicate edges and loops. 8 The edges removed if duplicates exist are arbitrary. \8Adjoin duplicate edges by grouping the labels together. ]@Compact the graph by counting how many multiple edges there are 8 (considering only the two nodes and not the labels). ^:Compact the graph by adjoining identical duplicate edges. _AMap over the labels on the nodes, using the node values as well. `,Delete these labelled nodes from the graph. a=Convert the graph into one with positions stored in the node  labels. The / parameter denotes if the graph is directed or  not. b@Returns the positions of the nodes in the graph, as found using  Graphviz. The , parameter denotes if the graph is directed  or not. cCreate a cluster-lookup . d0Used when the clusters are assigned in a lookup  instance. eEChange the cluster values in the graph by having the largest cluster $ have the smallest cluster label. f1Change the cluster values using the given lookup . g Create an  of the size of each cluster. h?Return true if and only if the list contains a single element. i7If we need to only tell if the list contains more than n elements,  there's no need to find its length. j Add the length of each sublist. k-Returns the longest list in a list of lists. m/Group elements by the given grouping function. n<Returns the unique elements of the list in ascending order, 0 as well as the minimum and maximum elements. oShuffle 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.html D The adaptation mainly involved altering the code so that the new ! random seed is also returned. p;An efficient mean function by Don Stewart, available from:   5http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16#fast qACalculate the mean and standard deviation of a list of elements. r7Calculate the mean and standard deviation of a list of   values. sAFind the fixed point of a function with the given initial value. tAFind the fixed point of a function with the given initial value, & using the given equality function. u9Find the fixed point of a graph transformation function. &QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu&QRSTUVWXYZ[\]^_`abcdefghijklmnopqrsut%QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuGraphviz wrapper functions Ivan.Miljenovic@gmail.comv Convert the CB into  format with the given  s. wConvert the clustered CB into  format with the  given 's. Cluster the nodes based upon their  : clusters. x Convert the CB into a clustered  format using 4 the given clustering function and with the given s. yA function to convert an  to the required ! & for use with the GraphViz library. z3Used to state that GraphViz should use the default s  for the given value. {Print a path, with "->" between each element. |Print a path, with "->" between each element. }=Print a cycle: copies the first node to the end of the list,  and then calls {. ~=Print a cycle: copies the first node to the end of the list,  and then calls |. 2Show a group of nodes, with no implicit ordering. 2Show a group of nodes, with no implicit ordering. Attempt to convert the String form of a list into 9 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 String @ 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 Strings 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 7 separation string between elements in the same row. 2Attempt to convert the combined form of a list of Strings ? into as much of a square shape as possible, using the given 7 separation string between elements in the same row. DUsing the given line length and allowed error, take the elements of  the next line. BRecursively build the rest of the line with given maximum length. vwxyz{|}~vwxyz{|}~vwxyz{|}~ Algorithms for all graph types. Ivan.Miljenovic@gmail.com*Find all connected components of a graph. 9Find the next component and split it off from the graph. 8Extract the given node and all nodes it is transitively  connected to from the graph. Helper function for  above. >Find all possible paths from this given node, avoiding loops,  cycles, etc. Remove all outgoing edges HFinds all cliques (i.e. maximal complete subgraphs) in the given graph. :Finds all cliques in the graph, without including labels. 9Determine 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. =Recursively find all regular subgraphs only containing nodes  in the given list. ;Return 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. KFind all cycles in the given graph, excluding those that are also cliques. KFind all cycles in the given graph, excluding those that are also cliques. *Find all cycles containing a chosen node.  $Find all cycles for the given node. $Find all chains in the given graph. $Find all chains in the given graph.  'Find the chain starting with the given .  !Find the next link in the chain.  6Determines if the given node is the start of a chain.  DDetermine if the given node matches the chain criteria in the given A direction, and if so what the next node in that direction is. !Find the next node in the chain. CDetermines if this node matches the successor criteria for chains. EDetermines if this node matches the predecessor criteria for chains.  Algorithms for directed graphs. Ivan.Miljenovic@gmail.comDetermine 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 F 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 0,  nodes in level n are at least n edges away from a root node.  Obtain the levels in the graph. AThe shortest paths to each of the leaves in the graph (excluding A singletons). This can be used to obtain an indication of the  overall height/depth of the graph. AGiven the list of roots in this graph, find the shortest path to  this leaf node. $Clustering and grouping algorithms. Ivan.Miljenovic@gmail.com>A collapsed node contains a list of nodes that it represents. 'The actual Chinese Whispers algorithm. #Choose a new cluster for the given . Note that this updates 6 the graph each time a new cluster value is chosen. #Choose a new cluster for the given Context. FChoose which cluster to pick by taking the one with maximum number of = nodes. If more than one has the same maximum, choose one  randomly. KConvert the graph into a form suitable for the Chinese Whispers algorithm. EThe renamed CLUSTER algorithm. Attempts to cluster a graph by using + the spatial locations used by Graphviz. !The Euclidian distance function. ,Converts the positional labels into an RNG. BDetermines if the two given nodes should be connected in the RNG. K Nodes are connected if there is no node that is closer to both of them. 5Performs the actual clustering algorithm on the RNG. ACollapse the cliques, cycles and chains in the graph down. Note  that this doesn'2t 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. >Use the given functions to determine which nodes to collapse, 6 with a new label to represent the collapsed nodes. Collapse the graph. Return 3 if the collapsed graph is either a singleton node I 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. ,Collapse all results of the given function. "Graph analysis algorithms Ivan.Miljenovic@gmail.com& $A Graph-Theoretic Analysis Library. Ivan.Miljenovic@gmail.com $This represents the information that's being passed in that we want F 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. CImport data into a format suitable for analysis. This function is   edge-safe+: if any datums are listed in the edges of    that aren'(t listed in the data points, then those 2 edges are ignored. Thus, no sanitation of the   in   ImportParams3 is necessary. The unused relations are stored in  G.. Note that it is assumed that all datums in    are also contained within  . IReturns the mean and standard deviations of the lengths of the sublists, H as well all those lists more than one standard deviation longer than  the mean. CCompare the actual roots in the graph with those that are expected  (i.e. those in H). Returns (in order): 1 Those roots that are expected (i.e. elements of H  that are roots). A Those roots that are expected but not present (i.e. elements of  H that aren't roots. - Unexpected roots (i.e. those roots that aren' t present in  H). Only return those chains (see ) where the non-initial  nodes are not expected roots.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd  !"#$%&'(./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ e # $%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeefghijklmnopqrstuvwxyz{|}~                 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Graphalyze-0.7.0.0Data.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.InternalbasePrelude fgl-5.4.2.2Data.Graph.Inductive.Graphgraphviz-2999.6.0.0Data.GraphViz.TypesData.GraphViz.Attributesfilepath-1.1.0.2System.FilePath.Posix Data.Maybe System.IO pandoc-1.2.1Text.Pandoc.SharedText.Pandoc.DefinitionData.Ordghc-primGHC.Bool Data.Eithercontainers-0.2.0.1 Data.IntMap GHC.Types Data.GraphVizData.Graph.Analysis.AlgorithmsRel addLabels GraphSize DefaultSize GivenSizeDocGraph DocInlineDocImageDocLinkEmphasisBoldGrouping BlankSpaceText DocElement GraphImage DefinitionItemized Enumeration ParagraphSectionLocationFileWebDocumentGeneratorcreateDocument docExtensionDocumentDoc rootDirectory fileFrontgraphDirectorytitleauthordatecontenttodaytryCreateDirectory createGraph createSize unDotPathPandocDocument pandocHtml pandocLaTeX pandocRtfpandocMarkdownPosLabelPLabelxPosyPospnodeplabel GenClusterGCclustnLbl ClusterType clusterID ClusterLabelCluster NodeLabelcluster nodeLabelLNGroupNGroupAGr GraphDatagraphwantedRootNodes directedDataunusedRelationships wantedRootsapplyAlg applyDirAlg mapAllNodes mapNodeType mergeUnused removeUnused updateGraph updateGraph'nodelabellabelsedgeeLabel filterNodes filterNodes' pathValuesundironeWaymkSimplecompactcompact' compactSamenlmap delLNodes toPosGraph getPositions createLookup setCluster reCluster reClusterBy clusterCountsingle longerThan addLengthslongest lengthSort groupElems sortMinMaxshufflemean statistics statistics'fixPoint fixPointByfixPointGraphsgraphvizgraphvizClustersgraphvizClusters' assignCluster noAttributesshowPath 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 levelGraph leafMinPathsCNodeschineseWhispersrelativeNeighbourhood collapseGraphcollapseGraphBycollapseGraphBy'trivialCollapse ImportParamsParams dataPoints relationshipsrootsdirectedversion importDatalengthAnalysis classifyRootsinteriorChains getBinDir getLibDir getDataDir getLibexecDirgetDataFileNamesqfIGHC.Real fromIntegralswap applyBothNode mkNodeMap applyNodesfromNodetoNoderelLabelrelsToEsDotGraphSize<.>Nothing graphImagesetSizePoint GHC.IOBaseFilePath PandocProcesswriter extensionheader graphSize extGraphSizepd writerOptions WriterOptionsdefaultProcess createPandocmakeMetahtmlInfo loc2targetinlineselements multiElems multiElems'BlockGHC.Baseconst GHC.ClassesOrdLNodeTrueFalseLeftRightEitherStrIntDblHTMLGraphIDEdgeLEdgeLPathBoolIntMap AttributeData.GraphViz.Types.Clustering NodeClustertakeLentakeLinesplitComponent extractNode nodeExtractormakeLeafisClique findRegularOf regularOf alsoRegulartwoCycle findCycles cyclesForgetChain chainLink isChainStart chainFind chainNexthasNexthasPrev graphLevelslfMinPth whisperNodewhisper chooseWhisper addWhispers euclidianmakeRNG areRelative nbrCluster collapseGrmakeCollapsiblecollapse collapseAll collapseAllByequaldeg'indeg'outdeg'inn'out'lpre'lsuc'pre'suc' neighbors'labNode'lab'node'degindegoutdeginnoutlprelsucpresuc neighborslabcontextmkUGraphbuildGrdelEdgesdelNodesinsEdgesinsNodesdelLEdgedelEdgedelNodeinsEdgeinsNodegelemnewNodesedgesnodesemapnmapgmapufoldUNodeUEdgePathLPUPathAdjContextMContextDecompGDecompUContextUDecomplabEdges nodeRangenoNodesmatchAnylabNodesmkGraphmatchisEmptyemptyGraph&DynGraph