#!/usr/bin/env python3 """Shift all vertex IDs by -1 in-place for the avazu hypergraph to match MaxEmbed's `num < c` invariant (max must be < num_vertices). Applied to both avazu.bin (binary) and avazu_hypergraph.txt (text).""" import numpy as np import os import time import struct txt_path = '/home/sadoo/research_data/processed/avazu/maxembed_paper_scale/avazu_hypergraph.txt' bin_path = '/home/sadoo/research_data/processed/avazu/maxembed_paper_scale/avazu.bin' # --- Binary: shift pins by 1 --- t0 = time.time() print(f'Shifting binary {bin_path}') with open(bin_path, 'rb') as f: query_cnt = struct.unpack('