working on karger algo. added new implementation with HashMap