<?php
$num_nodes = 64;
$edges = [
[0, 1],
[0, 52],
[1, 0],
[1, 2],
[2, 1],
[2, 3],
[3, 2],
[3, 4],
[4, 3],
[4, 5],
[5, 4],
[5, 6],
[6, 5],
[6, 7],
[7, 6],
[7, 8],
[8, 7],
[8, 9],
[9, 8],
[9, 10],
[10, 9],
[10, 11],
[11, 10],
[11, 12],
[12, 11],
[12, 58],
[13, 14],
[13, 53],
[13, 54],
[14, 13],
[14, 15],
[15, 14],
[15, 16],
[16, 15],
[16, 17],
[17, 16],
[17, 18],
[18, 17],
[18, 19],
[19, 18],
[19, 20],
[20, 19],
[20, 21],
[21, 20],
[21, 22],
[22, 21],
[22, 23],
[23, 22],
[23, 24],
[24, 23],
[24, 25],
[25, 24],
[25, 59],
[25, 60],
[26, 27],
[26, 55],
[26, 56],
[27, 26],
[27, 28],
[28, 27],
[28, 29],
[29, 28],
[29, 30],
[30, 29],
[30, 31],
[31, 30],
[31, 32],
[32, 31],
[32, 33],
[33, 32],
[33, 34],
[34, 33],
[34, 35],
[35, 34],
[35, 36],
[36, 35],
[36, 37],
[37, 36],
[37, 38],
[38, 37],
[38, 61],
[38, 62],
[39, 40],
[39, 57],
[40, 39],
[40, 41],
[41, 40],
[41, 42],
[42, 41],
[42, 43],
[43, 42],
[43, 44],
[44, 43],
[44, 45],
[45, 44],
[45, 46],
[46, 45],
[46, 47],
[47, 46],
[47, 48],
[48, 47],
[48, 49],
[49, 48],
[49, 50],
[50, 49],
[50, 51],
[51, 50],
[51, 63],
[52, 0],
[52, 53],
[53, 13],
[53, 52],
[54, 13],
[54, 55],
[55, 26],
[55, 54],
[56, 26],
[56, 57],
[57, 39],
[57, 56],
[58, 12],
[58, 59],
[59, 25],
[59, 58],
[60, 25],
[60, 61],
[61, 38],
[61, 60],
[62, 38],
[62, 63],
[63, 51],
[63, 62]
];
$bin_mapping = [
'A1' => 1,
'B1' => 1,
'A2' => 2,
'B2' => 2,
'A3' => 3,
'B3' => 3,
'A4' => 4,
'B4' => 4,
'A5' => 5,
'B5' => 5,
'A6' => 6,
'B6' => 6,
'A7' => 7,
'B7' => 7,
'A8' => 8,
'B8' => 8,
'A9' => 9,
'B9' => 9,
'A10' => 10,
'B10' => 10,
'A11' => 11,
'B11' => 11,
'C1' => 14,
'D1' => 14,
'C2' => 15,
'D2' => 15,
'C3' => 16,
'D3' => 16,
'C4' => 17,
'D4' => 17,
'C5' => 18,
'D5' => 18,
'C6' => 19,
'D6' => 19,
'C7' => 20,
'D7' => 20,
'C8' => 21,
'D8' => 21,
'C9' => 22,
'D9' => 22,
'C10' => 23,
'D10' => 23,
'C11' => 24,
'D11' => 24,
'E1' => 27,
'F1' => 27,
'E2' => 28,
'F2' => 28,
'E3' => 29,
'F3' => 29,
'E4' => 30,
'F4' => 30,
'E5' => 31,
'F5' => 31,
'E6' => 32,
'F6' => 32,
'E7' => 33,
'F7' => 33,
'E8' => 34,
'F8' => 34,
'E9' => 35,
'F9' => 35,
'E10' => 36,
'F10' => 36,
'E11' => 37,
'F11' => 37,
'G1' => 40,
'G2' => 41,
'G3' => 42,
'G4' => 43,
'G5' => 44,
'G6' => 45,
'G7' => 46,
'G8' => 47,
'G9' => 48,
'G10' => 49,
'G11' => 50,
'start' => 14,
];
$node_to_bin_mapping = [];
foreach ( $bin_mapping as $bin => $node_id ) {
if ( !array_key_exists( $node_id, $node_to_bin_mapping ) ) {
$node_to_bin_mapping[$node_id] = [];
}
$node_to_bin_mapping[$node_id][] = $bin;
}
|