Quantum foam and topological strings