((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/graph-separators" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "graph-separators" (p "Determine the separation vertices of a graph.") (toc)) (section 2 "Usage" (p "(require-extension graph-separators)")) (section 2 "Documentation" (p "A graph is said to have a separation vertex " (tt "v") " (sometimes called an articulation point) if there exist vertices " (tt "a") " and " (tt "b") ", where " (tt "a != b") " and " (tt "b != v") ", and all paths connecting " (tt "a") " and " (tt "b") " pass through " (tt "v") ". A graph which has a separation vertex is called separable, and one which has none is called non-separable.") (section 3 "Procedures" (def (sig (procedure "graph-separation-vertices:: G -> SEPARATORS * COMPONENTS" (id graph-separation-vertices))) (p "Computes the separation vertices of the given graph. Returns a list of separation vertices and a list of graph components that contain a separation vertex.")))) (section 2 "Examples" (pre "(require-extension srfi-1)\n(require-extension digraph)\n(require-extension graph-separators)\n\n(define g (make-digraph 'depgraph \"dependency graph\"))\n\n(define used-by\n   (list \n     (cons 'dax_h 'foo_cpp) (cons 'def_h 'foo_cpp) (cons 'xyz_h 'foo_cpp)\n     (cons 'foo_cpp 'libfoobar_a ) (cons 'foo_cpp 'libzigzag_a)\n     (cons 'libfoobar_a 'app) (cons 'libzigzag_a 'app)\n   ))\n\n(define node-list (delete-duplicates \n\t\t   (concatenate (list (map car used-by) (map cdr used-by)))))\n\n(define node-ids (list-tabulate (length node-list) values))\n \n(for-each (lambda (i n) ((g 'add-node!) i (list #f n))) node-ids node-list)\n(define node-map (zip node-list node-ids))\n\n(for-each (lambda (e) \n\t    (match e ((ni . nj) (let ((i (car (alist-ref ni node-map)))\n\t\t\t\t      (j (car (alist-ref nj node-map))))\n\t\t\t\t  ((g 'add-edge!) (list i j (format \"~A->~A\" ni nj)))))\n\t\t   (else (error \"invalid edge \" e))))\n\t  used-by)\n\n(graph-separation-vertices g)\n\n")) (section 2 "About this egg" (section 3 "Author" (p "Richard Kelsey; ported to Chicken by " (int-link "/users/ivan-raikov" "Ivan Raikov"))) (section 3 "Version history" (dl (dt "1.4") (dd "Documentation converted to wiki format") (dt "1.3") (dd "Ported to Chicken 4") (dt "1.0") (dd "Initial release"))) (section 3 "License" (pre "Copyright by Richard Kelsey.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n- Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following\ndisclaimer in the documentation and/or other materials provided\nwith the distribution.\n\n- Neither name of the copyright holders nor the names of its\ncontributors may be used to endorse or promote products derived\nfrom this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND THE\nCONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR THE\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF\nUSE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\nAND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE."))))