Esempio n. 1
0
    def __init__(self, n_vertices, n_loops, n_hairs_a, n_hairs_b, even_edges,
                 even_hairs_a, even_hairs_b):
        """Initialize the bi colored hairy graph vector space.

        :param n_vertices: Number of internal vertices.
        :type n_vertices: int
        :param n_loops: Number of loops.
        :type n_loops: int
        :param n_hairs_a: Number of hairs of the first colour.
        :type n_hairs_a: int
        :param n_hairs_b: Number of hairs of the second colour.
        :type n_hairs_b: int
        :param even_edges: True for even edges, False for odd edges.
        :type even_edges: bool
        :param even_hairs_a: Parity of the hair vertices of the first colour. True for even hairs_a, False for odd hairs_a.
        :type even_hairs_a: bool
        :param even_hairs_b: Parity of the hair vertices of the second colour. True for even hairs_a, False for odd hairs_b.
        :type even_hairs_b: bool
        """
        self.n_vertices = n_vertices
        self.n_loops = n_loops
        self.n_hairs_a = n_hairs_a
        self.n_hairs_b = n_hairs_b
        self.n_hairs = self.n_hairs_a + self.n_hairs_b
        self.even_edges = even_edges
        self.even_hairs_a = even_hairs_a
        self.even_hairs_b = even_hairs_b
        self.n_edges = self.n_loops + self.n_vertices - 1
        self.sub_type = get_sub_type(self.even_edges, self.even_hairs_a,
                                     self.even_hairs_b)
        super(BiColoredHairyGraphVS, self).__init__()
        self.ogvs = OrdinaryGraphComplex.OrdinaryGVS(
            self.n_vertices + self.n_hairs, self.n_loops, self.even_edges)
Esempio n. 2
0
    def __init__(self, deg, even_edges):
        """Initialize the degree slice.

        :param deg: Total degree of the degree slice.
        :type deg: int
        :param even_edges: True for even edges, False for odd edges.
        :type even_edges: bool
        """
        self.even_edges = even_edges
        self.sub_type = OrdinaryGraphComplex.sub_types.get(even_edges)
        super(VertexLoopDegSlice, self).__init__([
            OrdinaryGraphComplex.OrdinaryGVS(v, deg - v, self.even_edges)
            for v in range(0, deg + 1)
        ], deg)
Esempio n. 3
0
    def __init__(self, n_vertices, n_loops, n_hairs, n_ws):
        """Initialize the hairy graph vector space.

        :param n_vertices: Number of internal vertices. TODO: sure it is only internal?
        :type n_vertices: int
        :param n_loops: the genus of the graph.
        :type n_loops: int
        :param n_hairs: Number of hairs. They are distinguishable, numbered 1,...,n
        :type n_hairs: int
        :param n_ws: Number of w decorated hairs.
        :type even_edges: int
        """
        self.n_vertices = n_vertices
        self.n_loops = n_loops
        self.n_hairs = n_hairs
        self.n_ws = n_ws
        # we count only the internal edges and omega and eps edges, but not the hair edges
        self.n_edges = self.n_loops + self.n_vertices
        self.sub_type = "w"
        super(WHairyGraphVS, self).__init__()
        self.ogvs = OrdinaryGraphComplex.OrdinaryGVS(
            self.n_vertices + self.n_hairs + 2, self.n_loops, False)
Esempio n. 4
0
    def __init__(self, n_vertices, n_loops, n_hairs, even_edges, even_hairs):
        """Initialize the hairy graph vector space.

        :param n_vertices: Number of internal vertices.
        :type n_vertices: int
        :param n_loops: Number of loops.
        :type n_loops: int
        :param n_hairs: Number of hairs.
        :type n_hairs: int
        :param even_edges: True for even edges, False for odd edges.
        :type even_edges: bool
        :param even_hairs: Parity of the hair vertices. True for even hairs, False for odd hairs.
        :type even_hairs: bool
        """
        self.n_vertices = n_vertices
        self.n_loops = n_loops
        self.n_hairs = n_hairs
        self.even_edges = even_edges
        self.even_hairs = even_hairs
        self.n_edges = self.n_loops + self.n_vertices - 1
        self.sub_type = sub_types.get((self.even_edges, self.even_hairs))
        super(HairyGraphVS, self).__init__()
        self.ogvs = OrdinaryGraphComplex.OrdinaryGVS(self.n_vertices + self.n_hairs, self.n_loops, self.even_edges)
Esempio n. 5
0
 def setUp(self):
     self.vs_list = [
         OrdinaryGraphComplex.OrdinaryGVS(v, l, even_edges) for (
             v, l,
             even_edges) in itertools.product(v_range, l_range, edges_types)
     ]
Esempio n. 6
0
"""Generate sample images of graphs to be used on the webpage."""

import SpecialGraphs
import Parameters
import OrdinaryGraphComplex
import HairyGraphComplex
import StoreLoad

imgdir = Parameters.web_dir + "/img/"
StoreLoad.makedirs(imgdir)

# Commutatie graph complex
G = SpecialGraphs.wheel_graph(7)
VS = OrdinaryGraphComplex.OrdinaryGVS(8, 7, False)
# p = VS.plot_graph(G)
p = G.plot(vertex_labels=False, transparent=True)
p.save(imgdir + "wheel7.png")


# hairy graph complex
G = SpecialGraphs.hedgehog_graph(5)
VS = HairyGraphComplex.HairyGraphVS(5, 1, 5, False, False)
p = G.plot(vertex_labels=False, transparent=True)
p.save(imgdir + "hedgehog5.png")