A Physical interpretation of graph connectivity and its algorithmic applications