Pair of vector c ++

1

I have implemented the traveling salesman and show the minimum cost of all the paths. Now I want to show the path that corresponds to the lowest cost. I'm using to do this a pair<int, vector<int> > x , where as first I put the minimum cost and in the second I put my path vector.

When I put x.make_pair(custoMinimo, push_back(caminho)) , it gives the error:

struct std::pair<int, std::vector<int> >’ has no member named ‘make_pair’

Does anyone have any idea how to fix this?

    
asked by anonymous 07.10.2014 / 18:14

1 answer

2

make_pair is not a method of the x instance, and a method that returns a pair. So you have to use it like this:

x = make_pair(custoMinimo, push_back(caminho))
    
07.10.2014 / 18:45