A multipoint geostatistics computer-implemented method for modeling of discrete properties, comprising acquiring by a computer software program a training image made from at least one dimensional array of discrete property values, the values depicting the spatial relationship and variability considered to be typical of a n-dimensional surface to be modeled; constructing a search tree, the tree representing the probability of occurrence of combinations of values of a discrete property value, the construction being performed by counting these occurrences in the training image. The non-branching sequences of the search tree are compressed to what essentially amounts to a single node, by keeping only the relevant information the sequences contain.