Make zero graph list have an infinite distance