1. A system for computations to learn the relationships and patterns in a set of observed objects, the system comprising: circuitry configured to implement parallel and sequential implementation versions of an algorithm for search and sampling of structures; and perform two dimensional encoding of ordering between the variables to facilitate efficient computations, fixed point representation of values for efficient computation.