udm.copyline#

Classes#

CopyLine

Represents a T-shaped path in the grid for each vertex in the original graph.

Block

Represents a block in the crossing lattice.

CrossingLattice

Represents a crossing lattice of lines with potential crossing points.

Functions#

create_copylines(→ List[CopyLine])

Create copy lines for a graph with a given vertex order.

Module Contents#

class CopyLine#

Represents a T-shaped path in the grid for each vertex in the original graph.

vertex#

The vertex ID from the original graph

vslot#

Vertical slot position (column position)

hslot#

Horizontal slot position (row position)

vstart#

Starting point of the vertical segment

vstop#

Ending point of the vertical segment

hstop#

Ending point of the horizontal segment (there is no hstart)

vertex: int#
vslot: int#
hslot: int#
vstart: int#
vstop: int#
hstop: int#
class Block#

Represents a block in the crossing lattice.

top#

Top connection (-1 means no line)

bottom#

Bottom connection (-1 means no line)

left#

Left connection (-1 means no line)

right#

Right connection (-1 means no line)

connected#

-1 for not exist, 0 for not connected, 1 for connected

top: int = -1#
bottom: int = -1#
left: int = -1#
right: int = -1#
connected: int = -1#
get_row_strings()#

Return a 3-row string representation of the block.

class CrossingLattice(width, height, lines, graph)#

Represents a crossing lattice of lines with potential crossing points.

width#

Width of the lattice

height#

Height of the lattice

lines#

List of CopyLine objects

graph#

The original graph

width#
height#
lines#
graph#
shape()#

Return the shape of the lattice.

create_copylines(g, vertex_order: List[int]) List[CopyLine]#

Create copy lines for a graph with a given vertex order.

Parameters:
  • g – The input graph

  • vertex_order – The order of vertices

Returns:

A list of CopyLine objects