Algorithmic aspects of connectivity and density in graphs and hypergraphs