In [1]:
from sokoenginepy.variant.board_graph_graphtool import BoardGraph as BoardGraphGT
from sokoenginepy.variant.board_graph_networkx import BoardGraph as BoardGraphNX
from sokoenginepy.variant import GraphType
from sokoenginepy.core import Tessellation
from sokoenginepy import BoardCell, Direction, Variant

In [2]:
b = BoardGraphGT(6 * 7, GraphType.DIRECTED)
b.reconfigure_edges(6, 7, Tessellation.factory(Variant.SOKOBAN))
g = b._graph

In [3]:
g.list_properties()


cell           (vertex)  (type: python::object)
direction      (edge)    (type: python::object)
weight         (edge)    (type: int32_t)

In [4]:
g.ep.weight


Out[4]:
<PropertyMap object with key type 'Edge' and value type 'int32_t', for Graph 0x7f3640548e10, at 0x7f3640548f98, with values:
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]>

In [5]:
b.shortest_path(1, 4)


Out[5]:
([<Vertex object with index '1' at 0x7f3640526b88>,
  <Vertex object with index '2' at 0x7f3640526b10>,
  <Vertex object with index '3' at 0x7f3640526930>,
  <Vertex object with index '4' at 0x7f36405265e8>],
 [<Edge object with source '1' and target '2' at 0x7f364054e318>,
  <Edge object with source '2' and target '3' at 0x7f364054e288>,
  <Edge object with source '3' and target '4' at 0x7f364054e168>])

In [6]:
b.dijkstra_path(1, 4)


Out[6]:
([<Vertex object with index '1' at 0x7f3640526d68>,
  <Vertex object with index '2' at 0x7f3640526cf0>,
  <Vertex object with index '3' at 0x7f3640526a20>,
  <Vertex object with index '4' at 0x7f3640526a98>],
 [<Edge object with source '1' and target '2' at 0x7f364054e4c8>,
  <Edge object with source '2' and target '3' at 0x7f364054e438>,
  <Edge object with source '3' and target '4' at 0x7f364054e3a8>])