Initialization is simply a matter of assigning to each queen its neighbor, and its column number. This slide shows how this is accomplished in C++.