Algorithms for solving crystal structure using texture