a. A cognitive map of spatial (left) and non-spatial (right) relational structures allows for new direct routes or relationships to be inferred from directly experienced relationships, dramatically accelerating learning and decision capabilities through generalization. b. Participants learned the rank of 16 individuals organized into a 2-D social hierarchy defined by competence and popularity. Participants never saw neither 1-D or 2-D social hierarchies, but they could learn it piecemeal from dyadic comparisons in one dimension at a time during behavioral training. We hypothesized neural activity would be modulated hexadirectionally by the inferred trajectories over the 2-D social space, as predicted by a hexagonal grid organization. c. The inferred trajectories can be categorized as aligned and misaligned with the mean grid orientation, , which is different for each participant. θ1 and θ2 show examples of aligned and misaligned trajectories, respectively. Greater activity is predicted when the inferred trajectory is aligned compared to misaligned because it passes over more grid fields, which generates hexadirectional grid-like modulation. d. Behavioral training procedure. On day 1 and day 2 of behavioral training, participants learned ranks of 16 individuals (face stimuli) in each of two dimensions (competence or popularity) through binary decisions about the higher rank individual in a pair who differed by only one rank level in a given dimension, with each dimension learned on a different day. Within a day, the order of pairs compared was further randomized. After behavioral training, participants performed 3 blocks of the “partner selection task” twice during fMRI scanning, with a gap between sessions of at least one week. After the second session, participants were asked to place individuals according to their believed combined rank in a 2-D space for the first time (placement task).