Solving the Two Color Problem: An Heuristic Algorithm

  • Elena Barcucci
  • Stefano Brocchi
  • Andrea Frosini
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6636)


The 2-color problem in discrete tomography requires to construct a 2-colored matrix consistent with a given set of projections representing the number of elements of each color in each one of its rows and columns.

In this paper, we describe an heuristic algorithm to find a solution of the 2-color problem, that has been recently proved to be NP-complete. The algorithm starts by computing a solution where elements of different colors may overlap, and then it proceeds in searching for switches that leave unaltered the projections but remove the overlaps. Experimental results show that this heuristic approach finds a solution in a short computational time to almost all the randomly generated 2-color instances, and it provides for the remaining ones a high quality approximation.


Discrete tomography reconstruction algorithm color problem 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Anstee, R.P.: Invariant sets of arcs in network flow problems. Discrete Applied Mathematics 13, 1–7 (1986)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Balogh, E., Sorantin, E., Nyúl, L.G., Palágyi, K., Kuba, A., Werkgartner, G., Spuller, E.: Virtual dissection of the colon: technique and first experiments with artificial and cadaveric phantoms. In: Proceedings of SPIE Medical Imaging 2002: Image Processing, San Diego, USA, vol. 4681, pp. 713–721 (2002)Google Scholar
  3. 3.
    Batenburg, K.J., Bals, S., Sijbers, J., Kuebel, C., Midgley, P.A., Hernandez, J.C., Kaiser, U., Encina, E.R., Coronado, E.A., Van Tendeloo, G.: 3D imaging of nanomaterials by discrete tomography. Ultramicroscopy 109(6), 730–740 (2009)CrossRefGoogle Scholar
  4. 4.
    Bentz, C., Costa, M.C., Picouleau, C., Ries, B., de Werra, D.: Degree-constrained edge partitioning in graphs arising from discrete tomography. Journal of Graph Algorithms and Applications 13(2), 99–118 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Brocchi, S., Frosini, A., Picouleau, C.: Reconstruction of binary matrices under fixed size neighborhood constraints. Theoretical Computer Science 406(1-2), 43–54 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Brocchi, S., Frosini, A., Rinaldi, S.: Solving some instances of the two color problem. In: Brlek, S., Reutenauer, C., Provençal, X. (eds.) DGCI 2009. LNCS, vol. 5810, pp. 505–516. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  7. 7.
    Chrobak, M., Dürr, M.: Reconstructing polyatomic structures from X-rays: NP completness proof for three atoms. Theoretical Computer Science 259, 81–98 (2001)MathSciNetCrossRefzbMATHGoogle Scholar
  8. 8.
    Costa, M.-C., de Werra, D., Picouleau, C., Schindl, D.: A solvable case of image reconstruction in discrete tomography. Discrete Applied Mathematics 148(3), 240–245 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Dürr, C., Guiñez, F., Matamala, M.: Reconstructing 3-colored grids from horizontal and vertical projections is NP-hard. In: Fiat, A., Sanders, P. (eds.) ESA 2009. LNCS, vol. 5757, pp. 776–787. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  10. 10.
    Gardner, R.J., Gritzmann, P.: Discrete tomography: determination of finite sets by X-rays. Trans. Amer. Math. Soc. 349, 2271–2295 (1997)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Gardner, R.J., Gritzmann, P., Pranenberg, D.: On the computational complexity of determining polyatomic structures by X-rays. Theoretical Computer Science 233, 91–106 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Herman, G.T., Kuba, A.: Discrete tomography: Foundations algorithms and applications. Birkhauser, Boston (1999)CrossRefzbMATHGoogle Scholar
  13. 13.
    Herman, G.T., Kuba, A.: Advances in Discrete Tomography and Its Applications. Birkhauser, Boston (2007)CrossRefzbMATHGoogle Scholar
  14. 14.
    Irving, R.W., Jerrum, M.R.: Three-dimensional statistical data security problems. SIAM Journal of Computing 23, 170–184 (1994)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Matej, S., Vardi, A., Hermann, G.T., Vardi, E.: Binary tomography using Gibbs priors. In: Herman, G.T., Kuba, A. (eds.) Discrete Tomography: Foundations, Algorithms and Applications, pp. 191–212. Birkhauser, Boston (1999)CrossRefGoogle Scholar
  16. 16.
    Prause, G.P.M., Onnasch, D.G.W.: Binary reconstruction of the heart chambers from biplane angiographic image sequence. IEEE Transactions Medical Imaging 15, 532–559 (1996)CrossRefGoogle Scholar
  17. 17.
    Ryser, H.J.: Combinatorial properties of matrices of zeros and ones. Canadian Journal of Mathematics 9, 371–377 (1957)MathSciNetCrossRefzbMATHGoogle Scholar
  18. 18.
    Shliferstein, A.R., Chien, Y.T.: Switching components and the ambiguity problem in the reconstruction of pictures from their projections. Pattern Recognition 10, 327–340 (1978)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Elena Barcucci
    • 1
  • Stefano Brocchi
    • 1
  • Andrea Frosini
    • 1
  1. 1.Dipartimento di Sistemi e InformaticaUniversità di FirenzeFirenzeItaly

Personalised recommendations