--- /dev/null
+# $Id$ $Revision$
+## Process this file with automake to produce Makefile.in
+
+pdfdir = $(pkgdatadir)/doc/pdf
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lib/sparse \
+ -I$(top_srcdir)/lib/sfdpgen \
+ -I$(top_srcdir)/lib/edgepaint \
+ -I$(top_srcdir)/lib/ingraphs \
+ -I$(top_srcdir)/lib/cgraph \
+ -I$(top_srcdir)/lib/cdt
+
+bin_PROGRAMS = edgepaint
+
+man_MANS = edgepaint.1
+pdf_DATA = edgepaint.1.pdf
+
+edgepaint_SOURCES = edgepaintmain.c
+edgepaint_CPPFLAGS = $(AM_CPPFLAGS)
+edgepaint_LDADD = \
+ $(top_builddir)/lib/edgepaint/libedgepaint_C.la \
+ $(top_builddir)/lib/ingraphs/libingraphs_C.la \
+ $(top_builddir)/lib/sfdpgen/libsfdpgen_C.la \
+ $(top_builddir)/lib/neatogen/libneatogen_C.la \
+ $(top_builddir)/lib/sparse/libsparse_C.la \
+ $(top_builddir)/lib/rbtree/librbtree_C.la \
+ $(top_builddir)/lib/common/libcommon_C.la \
+ $(top_builddir)/lib/cgraph/libcgraph.la \
+ $(top_builddir)/lib/cdt/libcdt.la \
+ $(ANN_LIBS) -lstdc++ -lm
+
+edgepaint.1.pdf: $(srcdir)/edgepaint.1
+ - @GROFF@ -e -Tps -man -t $(srcdir)/edgepaint.1 | @PS2PDF@ - - >edgepaint.1.pdf
+
+EXTRA_DIST = $(man_MANS) $(pdf_DATA) edgepaint.vcproj
+
+DISTCLEANFILES = $(pdf_DATA)
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="mingle"\r
+ ProjectGUID="{A6DF0D74-E4D1-4EF4-A642-59B0CF3E74BB}"\r
+ RootNamespace="mingle"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="196613"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ OutputDirectory="Debug"\r
+ IntermediateDirectory="Debug"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="0"\r
+ AdditionalIncludeDirectories="../../lib/ingraphs;../../lib/common;../../lib/cdt;../../lib/cgraph;../../lib/sparse;../../lib/sfdpgen;../../;../../lib/mingle"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"\r
+ MinimalRebuild="true"\r
+ BasicRuntimeChecks="3"\r
+ RuntimeLibrary="3"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="4"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="c:/graphviz-ms/bin/$(ProjectName).exe"\r
+ LinkIncremental="2"\r
+ AdditionalLibraryDirectories=""C:\graphviz-ms\bin";C:\gtk\lib"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ OutputDirectory="Release"\r
+ IntermediateDirectory="Release"\r
+ ConfigurationType="1"\r
+ CharacterSet="1"\r
+ WholeProgramOptimization="1"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ Optimization="2"\r
+ EnableIntrinsicFunctions="true"\r
+ AdditionalIncludeDirectories="../../lib/ingraphs;../../lib/common;../../lib/cdt;../../lib/cgraph;../../lib/sparse;../../lib/sfdpgen;../../;../../lib/mingle"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"\r
+ RuntimeLibrary="2"\r
+ EnableFunctionLevelLinking="true"\r
+ UsePrecompiledHeader="0"\r
+ WarningLevel="3"\r
+ DebugInformationFormat="3"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="c:/graphviz-ms/bin/$(ProjectName).exe"\r
+ LinkIncremental="2"\r
+ AdditionalLibraryDirectories=""C:\graphviz-ms\bin";C:\gtk\lib"\r
+ GenerateDebugInformation="true"\r
+ SubSystem="1"\r
+ OptimizeReferences="2"\r
+ EnableCOMDATFolding="2"\r
+ TargetMachine="1"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <Filter\r
+ Name="Source Files"\r
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+ >\r
+ <File\r
+ RelativePath=".\minglemain.c"\r
+ >\r
+ </File>\r
+ </Filter>\r
+ <Filter\r
+ Name="Header Files"\r
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+ >\r
+ </Filter>\r
+ <Filter\r
+ Name="Resource Files"\r
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+ >\r
+ </Filter>\r
+ <File\r
+ RelativePath=".\ReadMe.txt"\r
+ >\r
+ </File>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+#! /bin/bash
+
+# edgepaint - temporary wrapper script for .libs/edgepaint
+# Generated by libtool (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
+#
+# The edgepaint program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /home/yifanhu/GIT/graphviz-2.37.20140115.0545/cmd/edgepaint; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; LD_LIBRARY_PATH=/usr/lib64:/home/yifanhu/GraphViz/graphviz2.head/build/lib/:/home/yifanhu/GraphViz/graphviz2/built/lib/:/home/yifanhu/BLAS_LAPACK/MKL_MMA/:/home/yifanhu/GraphViz/graphviz2/built_sun/lib:/home/yifanhu//GraphViz/graphviz_verus_debug/build/lib; export LD_LIBRARY_PATH; PATH=/usr/bin:/usr/local/bin:/home/yifanhu/bin:.:/home/yifanhu/bin:/usr/common/bin:/usr/local/bin:/usr/bin/X11:/bin:/usr/bin:/usr/sbin:/usr/local:/usr/common/waves/bin:.; export PATH; gcc -g -O2 -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math -o \$progdir/\$file edgepaint-edgepaintmain.o -L/usr/local/lib ../../lib/edgepaint/.libs/libedgepaint_C.a ../../lib/ingraphs/.libs/libingraphs_C.a -L/home/yifanhu/GIT/graphviz-2.37.20140115.0545/build/lib ../../lib/sfdpgen/.libs/libsfdpgen_C.a ../../lib/neatogen/.libs/libneatogen_C.a ../../lib/sparse/.libs/libsparse_C.a ../../lib/rbtree/.libs/librbtree_C.a ../../lib/common/.libs/libcommon_C.a ../../lib/cgraph/.libs/libcgraph.so ../../lib/cdt/.libs/libcdt.so -lstdc++ -lm -Wl,-rpath -Wl,/home/yifanhu/GIT/graphviz-2.37.20140115.0545/lib/cgraph/.libs -Wl,-rpath -Wl,/home/yifanhu/GIT/graphviz-2.37.20140115.0545/lib/cdt/.libs -Wl,-rpath -Wl,/home/yifanhu/GIT/graphviz-2.37.20140115.0545/build/lib)"
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='2.4.2'
+ notinst_deplibs=' ../../lib/cgraph/libcgraph.la ../../lib/cdt/libcdt.la'
+else
+ # When we are sourced in execute mode, $file and $ECHO are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ file="$0"
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+ ECHO="printf %s\\n"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string --lt-
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's ../../libtool value, followed by no.
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=$0
+ shift
+ for lt_opt
+ do
+ case "$lt_opt" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'`
+ test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=.
+ lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'`
+ cat "$lt_dump_D/$lt_dump_F"
+ exit 0
+ ;;
+ --lt-*)
+ $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n "$lt_option_debug"; then
+ echo "edgepaint:edgepaint:${LINENO}: libtool wrapper (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ $ECHO "edgepaint:edgepaint:${LINENO}: newargv[$lt_dump_args_N]: $lt_arg"
+ lt_dump_args_N=`expr $lt_dump_args_N + 1`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+
+ if test -n "$lt_option_debug"; then
+ $ECHO "edgepaint:edgepaint:${LINENO}: newargv[0]: $progdir/$program" 1>&2
+ func_lt_dump_args ${1+"$@"} 1>&2
+ fi
+ exec "$progdir/$program" ${1+"$@"}
+
+ $ECHO "$0: cannot exec $program $*" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from $@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case " $* " in
+ *\ --lt-*)
+ for lt_wr_arg
+ do
+ case $lt_wr_arg in
+ --lt-*) ;;
+ *) set x "$@" "$lt_wr_arg"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core ${1+"$@"}
+}
+
+ # Parse options
+ func_parse_lt_options "$0" ${1+"$@"}
+
+ # Find the directory that this script lives in.
+ thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$ECHO "$file" | /bin/sed 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
+ # special case for '.'
+ if test "$thisdir" = "."; then
+ thisdir=`pwd`
+ fi
+ # remove .libs from thisdir
+ case "$thisdir" in
+ *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;;
+ .libs ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'edgepaint'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" ||
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ printf %s\n "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+ func_exec_program ${1+"$@"}
+ fi
+ else
+ # The program doesn't exist.
+ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $ECHO "This script is just a wrapper for $program." 1>&2
+ $ECHO "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
--- /dev/null
+.EQ
+delim $$
+.EN
+.de TQ
+. br
+. ns
+. TP \\$1
+..
+.TH CLARIFY 1 "26 February 2014"
+.SH NAME
+clarify \- edge coloring to disambiguate crossing edges
+.SH SYNOPSIS
+.B
+[
+.I options
+]
+[
+.BI \-o
+.I outfile
+]
+[
+.I files
+]
+.SH DESCRIPTION
+.B clarify
+takes as input a graph in DOT format with node position information (the \fIpos\fP attribute) and
+color the edges.
+.SH OPTIONS
+The following options are supported:
+.TP
+.BI \-accuracy="e"
+accuracy with which to find the maximally different coloring for each node with regard to its neighbors. Default e = 0.01.
+.TP
+.BI \-angle="a"
+if edge crossing is less than that angle a, then make the edge colors different. Default a=15.
+.TP
+.BI \-random_seed="s"
+random seed to use. s must be an integer. If s is negative, we do -s iterations with different seeds and pick the best.
+.TP
+.BI \-lightness="l1,l2"
+only applied for LAB color scheme: l1 must be integer >=0, l2 integer <=100, and l1 <=l2. By default we use 0,70
+.TP
+.BI \-share_endpoint
+if this option is specified, edges that shares an end point are not considered in conflict if they are close to parallel but is on the opposite ends of the shared point (around 180 degree).
+.TP
+.BI \-o " f"
+write output to file f (if not speficied, stdout).
+.TP
+.BI \-color_scheme="c"
+color scheme. It is a string of either rgb, gray, lab (default), or of the form #ff0000,#aabbed,#eeffaa representing a color pallet, or one of the ColorBrewer palettes: ColorBrewer_accent_3, ColorBrewer_accent_4, ColorBrewer_accent_5, ColorBrewer_accent_6, ColorBrewer_accent_7, ColorBrewer_accent_8, ColorBrewer_blues_3, ColorBrewer_blues_4, ColorBrewer_blues_5, ColorBrewer_blues_6, ColorBrewer_blues_7, ColorBrewer_blues_8, ColorBrewer_blues_9, ColorBrewer_brbg_10, ColorBrewer_brbg_11, ColorBrewer_brbg_3, ColorBrewer_brbg_4, ColorBrewer_brbg_5, ColorBrewer_brbg_6, ColorBrewer_brbg_7, ColorBrewer_brbg_8, ColorBrewer_brbg_9, ColorBrewer_bugn_3, ColorBrewer_bugn_4, ColorBrewer_bugn_5, ColorBrewer_bugn_6, ColorBrewer_bugn_7, ColorBrewer_bugn_8, ColorBrewer_bugn_9, ColorBrewer_bupu_3, ColorBrewer_bupu_4, ColorBrewer_bupu_5, ColorBrewer_bupu_6, ColorBrewer_bupu_7, ColorBrewer_bupu_8, ColorBrewer_bupu_9, ColorBrewer_dark2_3, ColorBrewer_dark2_4, ColorBrewer_dark2_5, ColorBrewer_dark2_6, ColorBrewer_dark2_7, ColorBrewer_dark2_8, ColorBrewer_gnbu_3, ColorBrewer_gnbu_4, ColorBrewer_gnbu_5, ColorBrewer_gnbu_6, ColorBrewer_gnbu_7, ColorBrewer_gnbu_8, ColorBrewer_gnbu_9, ColorBrewer_greens_3, ColorBrewer_greens_4, ColorBrewer_greens_5, ColorBrewer_greens_6, ColorBrewer_greens_7, ColorBrewer_greens_8, ColorBrewer_greens_9, ColorBrewer_greys_3, ColorBrewer_greys_4, ColorBrewer_greys_5, ColorBrewer_greys_6, ColorBrewer_greys_7, ColorBrewer_greys_8, ColorBrewer_greys_9, ColorBrewer_oranges_3, ColorBrewer_oranges_4, ColorBrewer_oranges_5, ColorBrewer_oranges_6, ColorBrewer_oranges_7, ColorBrewer_oranges_8, ColorBrewer_oranges_9, ColorBrewer_orrd_3, ColorBrewer_orrd_4, ColorBrewer_orrd_5, ColorBrewer_orrd_6, ColorBrewer_orrd_7, ColorBrewer_orrd_8, ColorBrewer_orrd_9, ColorBrewer_paired_10, ColorBrewer_paired_11, ColorBrewer_paired_12, ColorBrewer_paired_3, ColorBrewer_paired_4, ColorBrewer_paired_5, ColorBrewer_paired_6, ColorBrewer_paired_7, ColorBrewer_paired_8, ColorBrewer_paired_9, ColorBrewer_pastel1_3, ColorBrewer_pastel1_4, ColorBrewer_pastel1_5, ColorBrewer_pastel1_6, ColorBrewer_pastel1_7, ColorBrewer_pastel1_8, ColorBrewer_pastel1_9, ColorBrewer_pastel2_3, ColorBrewer_pastel2_4, ColorBrewer_pastel2_5, ColorBrewer_pastel2_6, ColorBrewer_pastel2_7, ColorBrewer_pastel2_8, ColorBrewer_piyg_10, ColorBrewer_piyg_11, ColorBrewer_piyg_3, ColorBrewer_piyg_4, ColorBrewer_piyg_5, ColorBrewer_piyg_6, ColorBrewer_piyg_7, ColorBrewer_piyg_8, ColorBrewer_piyg_9, ColorBrewer_prgn_10, ColorBrewer_prgn_11, ColorBrewer_prgn_3, ColorBrewer_prgn_4, ColorBrewer_prgn_5, ColorBrewer_prgn_6, ColorBrewer_prgn_7, ColorBrewer_prgn_8, ColorBrewer_prgn_9, ColorBrewer_pubu_3, ColorBrewer_pubu_4, ColorBrewer_pubu_5, ColorBrewer_pubu_6, ColorBrewer_pubu_7, ColorBrewer_pubu_8, ColorBrewer_pubu_9, ColorBrewer_pubugn_3, ColorBrewer_pubugn_4, ColorBrewer_pubugn_5, ColorBrewer_pubugn_6, ColorBrewer_pubugn_7, ColorBrewer_pubugn_8, ColorBrewer_pubugn_9, ColorBrewer_puor_10, ColorBrewer_puor_11, ColorBrewer_puor_3, ColorBrewer_puor_4, ColorBrewer_puor_5, ColorBrewer_puor_6, ColorBrewer_puor_7, ColorBrewer_puor_8, ColorBrewer_puor_9, ColorBrewer_purd_3, ColorBrewer_purd_4, ColorBrewer_purd_5, ColorBrewer_purd_6, ColorBrewer_purd_7, ColorBrewer_purd_8, ColorBrewer_purd_9, ColorBrewer_purples_3, ColorBrewer_purples_4, ColorBrewer_purples_5, ColorBrewer_purples_6, ColorBrewer_purples_7, ColorBrewer_purples_8, ColorBrewer_purples_9, ColorBrewer_rdbu_10, ColorBrewer_rdbu_11, ColorBrewer_rdbu_3, ColorBrewer_rdbu_4, ColorBrewer_rdbu_5, ColorBrewer_rdbu_6, ColorBrewer_rdbu_7, ColorBrewer_rdbu_8, ColorBrewer_rdbu_9, ColorBrewer_rdgy_10, ColorBrewer_rdgy_11, ColorBrewer_rdgy_3, ColorBrewer_rdgy_4, ColorBrewer_rdgy_5, ColorBrewer_rdgy_6, ColorBrewer_rdgy_7, ColorBrewer_rdgy_8, ColorBrewer_rdgy_9, ColorBrewer_rdpu_3, ColorBrewer_rdpu_4, ColorBrewer_rdpu_5, ColorBrewer_rdpu_6, ColorBrewer_rdpu_7, ColorBrewer_rdpu_8, ColorBrewer_rdpu_9, ColorBrewer_rdylbu_10, ColorBrewer_rdylbu_11, ColorBrewer_rdylbu_3, ColorBrewer_rdylbu_4, ColorBrewer_rdylbu_5, ColorBrewer_rdylbu_6, ColorBrewer_rdylbu_7, ColorBrewer_rdylbu_8, ColorBrewer_rdylbu_9, ColorBrewer_rdylgn_10, ColorBrewer_rdylgn_11, ColorBrewer_rdylgn_3, ColorBrewer_rdylgn_4, ColorBrewer_rdylgn_5, ColorBrewer_rdylgn_6, ColorBrewer_rdylgn_7, ColorBrewer_rdylgn_8, ColorBrewer_rdylgn_9, ColorBrewer_reds_3, ColorBrewer_reds_4, ColorBrewer_reds_5, ColorBrewer_reds_6, ColorBrewer_reds_7, ColorBrewer_reds_8, ColorBrewer_reds_9, ColorBrewer_set1_3, ColorBrewer_set1_4, ColorBrewer_set1_5, ColorBrewer_set1_6, ColorBrewer_set1_7, ColorBrewer_set1_8, ColorBrewer_set1_9, ColorBrewer_set2_3, ColorBrewer_set2_4, ColorBrewer_set2_5, ColorBrewer_set2_6, ColorBrewer_set2_7, ColorBrewer_set2_8, ColorBrewer_set3_10, ColorBrewer_set3_11, ColorBrewer_set3_12, ColorBrewer_set3_3, ColorBrewer_set3_4, ColorBrewer_set3_5, ColorBrewer_set3_6, ColorBrewer_set3_7, ColorBrewer_set3_8, ColorBrewer_set3_9, ColorBrewer_spectral_10, ColorBrewer_spectral_11, ColorBrewer_spectral_3, ColorBrewer_spectral_4, ColorBrewer_spectral_5, ColorBrewer_spectral_6, ColorBrewer_spectral_7, ColorBrewer_spectral_8, ColorBrewer_spectral_9, ColorBrewer_ylgn_3, ColorBrewer_ylgn_4, ColorBrewer_ylgn_5, ColorBrewer_ylgn_6, ColorBrewer_ylgn_7, ColorBrewer_ylgn_8, ColorBrewer_ylgn_9, ColorBrewer_ylgnbu_3, ColorBrewer_ylgnbu_4, ColorBrewer_ylgnbu_5, ColorBrewer_ylgnbu_6, ColorBrewer_ylgnbu_7, ColorBrewer_ylgnbu_8, ColorBrewer_ylgnbu_9, ColorBrewer_ylorbr_3, ColorBrewer_ylorbr_4, ColorBrewer_ylorbr_5, ColorBrewer_ylorbr_6, ColorBrewer_ylorbr_7, ColorBrewer_ylorbr_8, ColorBrewer_ylorbr_9, ColorBrewer_ylorrd_3, ColorBrewer_ylorrd_4, ColorBrewer_ylorrd_5, ColorBrewer_ylorrd_6, ColorBrewer_ylorrd_7, ColorBrewer_ylorrd_8, ColorBrewer_ylorrd_9
+.TP
+.BI \-v " k"
+determines the verbose level used for tracing the algorithm. The value \fIk\fP is optional; if not
+provided, the value 1 is used.
+.TP
+.BI \-?
+Print usage and exit.
+
+.SH BUGS
+At present, \fBclarify\fP does not handle graphs with loops or directed multiedges. So, a graph with edges
+\fIa -> b\fP and \fIb -> a\fP is acceptable, but not if it has edges \fIa -> b\fP and \fIa -> b\fP or
+\fIa -- b\fP and \fIa -- b\fP.
+.SH AUTHOR
+Yifan Hu <yifanhu@research.att.com>
+.SH "SEE ALSO"
+.PP
+gvmap(1)
+.PP
+
--- /dev/null
+
+/*************************************************************************
+ * Copyright (c) 2011 AT&T Intellectual Property
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef WIN32 /*dependencies*/
+ #pragma comment( lib, "cgraph.lib" )
+ #pragma comment( lib, "gvc.lib" )
+ #pragma comment( lib, "ingraphs.lib" )
+ #pragma comment( lib, "sparse.lib" )
+ #pragma comment( lib, "sfdp.lib" )
+ #pragma comment( lib, "clarifylib.lib" )
+ #pragma comment( lib, "neatogen.lib" )
+ #pragma comment( lib, "rbtree.lib" )
+ #pragma comment( lib, "cdt.lib" )
+#endif /* not WIN32_DLL */
+
+#include <cgraph.h>
+#include <agxbuf.h>
+#include <ingraphs.h>
+#include <pointset.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+#include "compat_getopt.h"
+#endif
+
+#include "general.h"
+#include "SparseMatrix.h"
+#include "DotIO.h"
+#include "node_distinct_coloring.h"
+#include "edge_distinct_coloring.h"
+#include "color_palette.h"
+
+typedef enum {
+ FMT_GV,
+ FMT_SIMPLE,
+} fmt_t;
+
+typedef struct {
+ Agrec_t hdr;
+ int idx;
+} etoi_t;
+
+#define ED_idx(e) (((etoi_t*)AGDATA(e))->idx)
+
+
+static char *fname;
+static FILE *outfile;
+
+static FILE *openFile(char *name, char *mode, char* cmd)
+{
+ FILE *fp;
+ char *modestr;
+
+ fp = fopen(name, mode);
+ if (!fp) {
+ if (*mode == 'r')
+ modestr = "reading";
+ else
+ modestr = "writing";
+ fprintf(stderr, "%s: could not open file %s for %s\n",
+ cmd, name, modestr);
+ exit(-1);
+ }
+ return (fp);
+}
+
+static void usage (char* cmd, int eval){
+ fprintf(stderr, "Usage: %s <options> gv file with 2D coordinates.\n", cmd);
+ fprintf(stderr, "Find a color assignment of the edges, such that edges that cross at small angle have as different as posible.\n");
+ fprintf(stderr, "Options are: \n");
+ fprintf(stderr, "-accuracy=e: accuracy with which to find the maximally different coloring for each node with regard to its neighbors. Default 0.01.\n");
+ fprintf(stderr, "-angle=a: if edge crossing is less than that angle a, then make the edge colors different. Default 15.\n");
+ fprintf(stderr, "-random_seed=s: random seed to use. s must be an integer. If s is negative, we do -s iterations with different seeds and pick the best.\n");
+ fprintf(stderr, "-color_scheme=c: color scheme. It is a string of either rgb, gray, lab (default), or of the form #ff0000,#aabbed,#eeffaa representing a color pallet, or one of the ColorBrewer palettes: ");
+ color_palettes_name_print(stderr);
+ fprintf(stderr," \n");
+ fprintf(stderr, "-lightness=l1,l2: only applied for LAB color scheme: l1 must be integer >=0, l2 integer <=100, and l1 <=l2. By default we use 0,70\n");
+ fprintf(stderr, "-share_endpoint: if this option is specified, edges that shares an end point are not considered in conflict if they are close to parallel but is on the opposite ends of the shared point (around 180 degree).\n");
+ fprintf(stderr, "-v: verbose\n");
+ fprintf(stderr, "-o fname - write output to file fname (stdout)\n");
+ exit(eval);
+}
+
+/* checkG:
+ * Return non-zero if g has loops or multiedges.
+ * Relies on multiedges occurring consecutively in edge list.
+ */
+static int
+checkG (Agraph_t* g)
+{
+ Agedge_t* e;
+ Agnode_t* n;
+ Agnode_t* h;
+ Agnode_t* prevh = NULL;
+
+ for (n = agfstnode (g); n; n = agnxtnode (g, n)) {
+ for (e = agfstout (g, n); e; e = agnxtout (g, e)) {
+ if ((h = aghead(e)) == n) return 1; // loop
+ if (h == prevh) return 1; // multiedge
+ prevh = h;
+ }
+ prevh = NULL; // reset
+ }
+ return 0;
+}
+
+
+static void init(int argc, char *argv[], real *angle, real *accuracy, char **infile, int *check_edges_with_same_endpoint, int *seed, char **color_scheme, char **lightness){
+
+ unsigned int c;
+ char* cmd = argv[0];
+ int cs_len = 10000;
+ int r, g, b;
+ outfile = NULL;
+
+ Verbose = FALSE;
+ *accuracy = 0.01;
+ *angle = 15;/* 10 degree by default*/
+ *infile = NULL;
+ *check_edges_with_same_endpoint = 0;
+ *seed = 123;
+ if (!(*color_scheme)) *color_scheme = malloc(sizeof(char)*cs_len);
+ strcpy(*color_scheme, "lab");
+ *lightness = NULL;
+
+ while ((c = getopt(argc, argv, ":vc:a:s:r:l:o")) != -1) {
+ switch (c) {
+ case 's':
+ *check_edges_with_same_endpoint = 1;
+ break;
+ case 'r':
+ if (strncmp(optarg,"andom_seed=", 11) == 0){
+ if (sscanf(optarg+11, "%d", seed) != 1){
+ fprintf(stderr,"-random_seed option must be a positive integer.\n");
+ usage(cmd, 1);
+ }
+ }
+ break;
+ case 'a':
+ if (strncmp(optarg,"ccuracy=", 8) == 0){
+ sscanf(optarg+8, "%lf", accuracy);
+ if (*accuracy <= 0) {
+ fprintf(stderr,"-accuracy option must be a positive real number.\n");
+ usage(cmd, 1);
+ }
+ } else if (strncmp(optarg,"ngle=", 5) == 0){
+ sscanf(optarg+5, "%lf", angle);
+ if (*angle <= 0 || *angle >= 90) {
+ fprintf(stderr,"-angle option must be a positive real number between 0 to 90.\n");
+ usage(cmd, 1);
+ }
+ } else {
+ fprintf(stderr,"-accuracy option must contain a positive real.\n");
+ usage(cmd, 1);
+ }
+ break;
+ case 'c':
+ if (strncmp(optarg,"olor_scheme=", 12) == 0){
+ if (strcmp(optarg + 12,"rgb") != 0 && strcmp(optarg + 12,"lab") != 0 && strcmp(optarg + 12,"gray") != 0 &&
+ (!color_palettes_Q(optarg + 12)) &&
+ sscanf(optarg + 12,"#%02X%02X%02X", &r, &g, &b) != 3){
+ fprintf(stderr,"-color_scheme option must be a valid string\n");
+ usage(cmd, 1);
+ } else {
+ if (strlen(*color_scheme) < strlen(optarg + 12)) *color_scheme = realloc(*color_scheme, sizeof(char)*(strlen(optarg + 12) + 1));
+ strcpy(*color_scheme, optarg + 12);
+ }
+ } else {
+ usage(cmd, 1);
+ }
+ break;
+ case 'l':{
+ int l1 = 0, l2 = 70;
+ if (strncmp(optarg,"ightness=", 9) == 0 && sscanf(optarg + 9, "%d,%d", &l1, &l2) == 2){
+ if (l1 < 0 || l2 > 100 || l1 > l2){
+ fprintf(stderr,"invalid -lightness=%s option.\n", optarg + 9);
+ usage(cmd, 1);
+ }
+ *lightness = malloc(sizeof(char)*10);
+ strcpy(*lightness, optarg + 9);
+ } else {
+ usage(cmd, 1);
+ }
+ break;
+ }
+ case 'v':
+ Verbose = TRUE;
+ break;
+ case 'o':
+ outfile = openFile(optarg, "w", CmdName);
+ break;
+ default:
+ if (optopt == '?')
+ usage(cmd, 0);
+ else
+ fprintf(stderr, "option -%c unrecognized - ignored\n",
+ optopt);
+ break;
+ }
+ }
+
+ argv += optind;
+ argc -= optind;
+
+ if (argc)
+ *infile = argv[0];
+
+ if (argc > 0) Files = argv;
+ if (!outfile) outfile = stdout;
+
+}
+
+
+static int clarify(Agraph_t* g, real angle, real accuracy, char *infile, int check_edges_with_same_endpoint, int seed, char *color_scheme, char *lightness){
+ enum {buf_len = 10000};
+
+ if (checkG(g)) {
+ agerr (AGERR, "Graph %s (%s) contains loops or multiedges\n");
+ return 1;
+ }
+
+ initDotIO(g);
+ g = edge_distinct_coloring(color_scheme, lightness, g, angle, accuracy, check_edges_with_same_endpoint, seed);
+ if (!g) return 1;
+
+ agwrite (g, stdout);
+ return 0;
+}
+
+static Agraph_t *gread(FILE * fp)
+{
+ return agread(fp, (Agdisc_t *) 0);
+}
+
+int main(int argc, char *argv[])
+{
+ char *infile;
+ real accuracy;
+ real angle;
+ int check_edges_with_same_endpoint, seed;
+ char *color_scheme = NULL;
+ char *lightness = NULL;
+ Agraph_t *g;
+ Agraph_t *prev = NULL;
+ ingraph_state ig;
+ int rv = 0;
+
+ init(argc, argv, &angle, &accuracy, &infile, &check_edges_with_same_endpoint, &seed, &color_scheme, &lightness);
+ newIngraph(&ig, Files, gread);
+
+ while ((g = nextGraph(&ig)) != 0) {
+ if (prev)
+ agclose(prev);
+ prev = g;
+ fname = fileName(&ig);
+ if (Verbose)
+ fprintf(stderr, "Process graph %s in file %s\n", agnameof(g),
+ fname);
+ rv |= clarify(g, angle, accuracy, infile, check_edges_with_same_endpoint, seed, color_scheme, lightness);
+ }
+
+ return rv;
+}