BTCH File Format
A binary file format for storing a time-dependent contraction hierarchy (TCH) used by KaTCH
("Karlsruhe Time-dependent Contraction Hierarchies")
Author: G. Veit Batz, batz@kit.edu, Karlsruhe Institute of Technology (KIT), April 2015
usual file suffix: .btch
File Format:
- a binary file
- layout:
- 6 x uint8_t: "
BTCH\r\n
" (0x42 0x54 0x43 0x48 0x0d 0x0a
)
- uint32_t: version (currently "
1
", shold be ==
compared)
- uint32_t: number of nodes (= n)
- uint32_t: number of edges (= m)
- uint32_t: period of the functions
- n times, for each node 0..(n-1):
- uint32_t: level
level must be one of 0..n, where n is a special value
meaning that the node has not been contracted (needed for imcomplete TCHs)
- uint32_t:
0x00772255
as separator
- m times, edges:
- uint32_t: id of source node
- uint32_t: id of target node
- shortcut descriptor:
- uint32_t: number s of intervals where the shortcut represents different edge pairs; s=0 means
that edge is not a shortcut but an original edge
- s times, for each interval [x_1, x2), [x_2, x_3),..., [x_s, x_s + period)
- double: left boundary of the current interval
- uint32_t: id of the node in the middle
- Note: If an interval represents no shortcut (this happens when a non-shortcut
edge is merged with a shortcut edge), then the middle node is the maximum value of uint32_t.
- travel time function:
- uint32_t: number k of points
- k times, points represented as pair (x,y):
- uint32_t:
0xaabbccdd
as terminator