Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in matching #1

Open
drussel opened this issue Mar 2, 2013 · 0 comments
Open

Possible bug in matching #1

drussel opened this issue Mar 2, 2013 · 0 comments
Labels

Comments

@drussel
Copy link
Owner

drussel commented Mar 2, 2013

int main() {
typedef boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS,

boost::property<boost::vertex_name_t, std::string>,
boost::property<boost::edge_weight_t,
double> > Graph;
Graph pg(4);
boost::property_map<Graph,
boost::vertex_name_t>::type
vm= boost::get(boost::vertex_name, pg);
boost::property_map<Graph,
boost::edge_weight_t>::type
ew= boost::get(boost::edge_weight, pg);

ew[boost::add_edge(0, 2, pg).first]=1;
ew[boost::add_edge(1, 2, pg).first]=3;
ew[boost::add_edge(1, 3, pg).first]=1;
std::vectorstd::pair<int,int > out
= get_maximum_weight_bipartite_matching(pg, 2,

boost::get(boost::vertex_index, pg),

boost::get(boost::edge_weight, pg));
for (unsigned int i=0; i < out.size(); ++i) {
std::cout << "edge " << out[i].first << "--" << out[i].second
<< std::endl;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant