Skip to content

Commit

Permalink
planar: add IsPlanarDigraph and related
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Jan 7, 2019
1 parent 6d81ae8 commit 3c0ab68
Show file tree
Hide file tree
Showing 31 changed files with 1,351 additions and 167 deletions.
62 changes: 22 additions & 40 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,80 +1,62 @@
*.DS_Store
*.Plo
*.Tpo
*.aux
*.bbl
*.blg
*.brf
*.digraphs
*.g6
*.gcda
*.gcno
*.guess
*.gz
*.html
*.idx
*.ilg
*.ind
*.la
*.lab
*.lo
*.log
*.o
*.orig
*.out
*.pdf
*.pnr
*.pyc
*.six
*.status
*.sub
*.swp
*.synctex.gz
*.tex
*.tex
*.toc
*.top
*.tui
*.txt
.libs/digraphs.la
.libs/digraphs.lai
.libs/**/digraphs.so
.libs/graphs.la
.libs/graphs.lai
.libs/graphs.so
.dirstamp
.libs/*
Makefile
Makefile.in
Transitions*
aclocal.m4
autom4te.*
bin/*
cnf/ar-lib
cnf/compile
cnf/config.guess
cnf/config.sub
cnf/depcomp
cnf/install-sh
cnf/ltmain.sh
cnf/missing
cnf/pkgconfig.h.in
config.status
cnf/*
configure
digraphs-config.h
digraphs-lib
digraphs.la
digraphs.tex
digraphs_dev.tex
digraphs_la-homos.Tpo
digraphs_la-schreier-sims.Tpo
graphs.la
gh-pages/
libtool
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
mt-cc.py
pkgconfig.h.in~
release-checklist.tst
src/.deps/.dirstamp
src/.deps/digraphs_la-digraphs.Plo
src/.deps/digraphs_la-digraphs.Tpo
src/.dirstamp
src/.libs/digraphs_la-digraphs.o
src/bliss-0.72/.deps/.dirstamp
src/bliss-0.72/.dirstamp
src/digraphs_la-digraphs.lo
ltmain.sh
m4/*
planarity
src/.deps/*
src/.libs/*
src/_pkgconfig.h
src/edge-addition-planarity-suite-Version_3.0.0.5/.libs
src/edge-addition-planarity-suite-Version_3.0.0.5/c/.deps
src/edge-addition-planarity-suite-Version_3.0.0.5/m4
src/stamp-h1
tags
tst/out/*
Expand Down
36 changes: 26 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,47 @@
# This file is part of the build system of a GAP kernel extension.
# Requires automake.
#

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = @PLANARITY_SUITE_DIR@

PLANAR_INCLUDE = -I@PLANARITY_SUITE_DIR@/

BINARCHDIR = bin/$(GAPARCH)
GAPINSTALLLIB = $(abs_top_srcdir)/$(BINARCHDIR)/digraphs.so
GAPINSTALLLIB = $(abs_top_srcdir)/$(BINARCHDIR)/

lib_LTLIBRARIES = digraphs.la

digraphs_la_SOURCES = src/digraphs.c src/homos.c src/perms.c src/schreier-sims.c
digraphs_la_SOURCES += src/bliss-0.73/defs.cc src/bliss-0.73/graph.cc
digraphs_la_SOURCES += src/bliss-0.73/partition.cc src/bliss-0.73/orbit.cc
digraphs_la_SOURCES += src/bliss-0.73/uintseqhash.cc src/bliss-0.73/heap.cc
digraphs_la_SOURCES += src/bliss-0.73/timer.cc src/bliss-0.73/utils.cc
digraphs_la_SOURCES = src/digraphs.c
digraphs_la_SOURCES += src/homos.c
digraphs_la_SOURCES += src/perms.c
digraphs_la_SOURCES += src/planar.c
digraphs_la_SOURCES += src/schreier-sims.c
digraphs_la_SOURCES += src/bliss-0.73/defs.cc
digraphs_la_SOURCES += src/bliss-0.73/graph.cc
digraphs_la_SOURCES += src/bliss-0.73/partition.cc
digraphs_la_SOURCES += src/bliss-0.73/orbit.cc
digraphs_la_SOURCES += src/bliss-0.73/uintseqhash.cc
digraphs_la_SOURCES += src/bliss-0.73/heap.cc
digraphs_la_SOURCES += src/bliss-0.73/timer.cc
digraphs_la_SOURCES += src/bliss-0.73/utils.cc
digraphs_la_SOURCES += src/bliss-0.73/bliss_C.cc

digraphs_la_CPPFLAGS = $(GAP_CPPFLAGS)
digraphs_la_CXXFLAGS = -O3 -march=native -mpopcnt
digraphs_la_CFLAGS = -O3 -march=native -mpopcnt $(GAP_CFLAGS)
digraphs_la_CPPFLAGS = $(GAP_CPPFLAGS)
digraphs_la_CXXFLAGS = -O3 -march=native -mpopcnt $(PLANAR_INCLUDE)
digraphs_la_CFLAGS = -O3 -march=native -mpopcnt $(GAP_CFLAGS) $(PLANAR_INCLUDE)
digraphs_la_LDFLAGS = $(GAP_LDFLAGS) -module -avoid-version

digraphs_la_LIBADD = @PLANARITY_SUITE_DIR@/libplanarity.la

if SYS_IS_CYGWIN
digraphs_la_LDFLAGS += -no-undefined -version-info 0:0:0 -Wl,$(GAPROOT)/bin/$(GAPARCH)/gap.dll
endif

all-local: digraphs.la
$(mkdir_p) $(top_srcdir)/$(BINARCHDIR)
$(mkdir_p) $(top_srcdir)/$(BINARCHDIR) $(top_srcdir)/bin/lib
cp -RL @PLANARITY_SUITE_DIR@/.libs/* $(top_srcdir)/bin/lib/
if SYS_IS_CYGWIN
cp .libs/digraphs.dll $(GAPINSTALLLIB)
else
Expand Down
8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# graphs:
# digraphs
#
# This file is part of the build system of a GAP kernel extension.
# Requires GNU autoconf, GNU automake and GNU libtool.
Expand All @@ -14,6 +14,10 @@ AC_CONFIG_SRCDIR([src/digraphs.c])
AC_CONFIG_HEADER([src/_pkgconfig.h:cnf/pkgconfig.h.in])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([cnf])
AC_CONFIG_SUBDIRS([src/edge-addition-planarity-suite-Version_3.0.0.5])

PLANARITY_SUITE_DIR=src/edge-addition-planarity-suite-Version_3.0.0.5
AC_SUBST(PLANARITY_SUITE_DIR)

dnl ##
dnl ## Get canonical host info
Expand All @@ -29,6 +33,8 @@ AM_PROG_AR

AX_PREFIX_CONFIG_H([src/digraphs-config.h],[],[src/_pkgconfig.h])

AC_PREFIX_DEFAULT('${abs_top_builddir}/../../bin/')

dnl ##
dnl ## Set the language
dnl ##
Expand Down
33 changes: 33 additions & 0 deletions doc/attr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1352,3 +1352,36 @@ gap> HamiltonianPath(g);
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="MaximalAntiSymmetricSubdigraph">
<ManSection>
<Attr Name="MaximalAntiSymmetricSubdigraph" Arg="digraph"/>
<Returns>A digraph.</Returns>
<Description>
If <A>digraph</A> is a digraph, then <C>MaximalAntiSymmetricSubdigraph</C>
returns a anti-symmetric subdigraph of <A>digraph</A> which does not have
multiple edges, has the same vertex set as <A>digraph</A>, and whose
edge list is formed from <A>digraph</A> by ignoring the multiplicity of
edges, and by having either an edge from the vertex <C>u</C> to the vertex
<C>v</C>, or the edge from <C>v</C> to <C>u</C> (but not both) whenever
both edges belong to <A>digraph</A>.
<P/>

See <Ref Prop="IsAntisymmetricDigraph"/> for more information.
<Example><![CDATA[
gap> D := Digraph([[2, 2], [1, 3], [4], [3, 1]]);
<multidigraph with 4 vertices, 7 edges>
gap> not IsAntiSymmetricDigraph(D) and IsMultiDigraph(D);
true
gap> OutNeighbours(D);
[ [ 2, 2 ], [ 1, 3 ], [ 4 ], [ 3, 1 ] ]
gap> D := MaximalAntiSymmetricSubdigraph(D);
<digraph with 4 vertices, 4 edges>
gap> IsAntiSymmetricDigraph(D) and not IsMultiDigraph(D);
true
gap> OutNeighbours(D);
[ [ 2 ], [ 3 ], [ 4 ], [ 1 ] ]
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
Loading

0 comments on commit 3c0ab68

Please sign in to comment.