<commit_before>/*
* EdmondsKarpGTest.cpp
 *
 *  Created on: 13.06.2014
 *      Author: <NAME> (<EMAIL>)
 */

#include "EdmondsKarpGTest.h"

namespace NetworKit {

TEST_F(EdmondsKarpGTest, tryEdmondsKarpP1) {
	Graph G(7, false);
	G.addEdge(0,1);
	G.addEdge(0,2);
	G.addEdge(0,3);
	G.addEdge(1,2);
	G.addEdge(1,4);
	G.addEdge(2,3);
	G.addEdge(2,4);
	G.addEdge(3,4);
	G.addEdge(3,5);
	G.addEdge(4,6);
	G.addEdge(5,6);

	EdmondsKarp edKa;
	int id;
	std::vector<node> sourceSet;
	edgeweight maxFlow = edKa.run(G, 0, 6, sourceSet, id);
	EXPECT_EQ(2, maxFlow) << "max flow is not correct";
	// FIXME: update to new edge attribute system
	// EXPECT_EQ(1, G.attribute_double(4,6,id));
	// EXPECT_EQ(1, G.attribute_double(5,6,id));

	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 0) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 1) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 2) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 3) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 4) != sourceSet.end());

	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 5) == sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 6) == sourceSet.end());
}

TEST_F(EdmondsKarpGTest, tryEdmondsKarpP2) {
	Graph G(6, true);
	G.addEdge(0,1, 5);<commit_msg>force failure of EdmondsKarp unit test<commit_after>/*
* EdmondsKarpGTest.cpp
 *
 *  Created on: 13.06.2014
 *      Author: <NAME> (<EMAIL>)
 */

#include "EdmondsKarpGTest.h"

namespace NetworKit {

TEST_F(EdmondsKarpGTest, tryEdmondsKarpP1) {
	Graph G(7, false);
	G.addEdge(0,1);
	G.addEdge(0,2);
	G.addEdge(0,3);
	G.addEdge(1,2);
	G.addEdge(1,4);
	G.addEdge(2,3);
	G.addEdge(2,4);
	G.addEdge(3,4);
	G.addEdge(3,5);
	G.addEdge(4,6);
	G.addEdge(5,6);

	EdmondsKarp edKa;
	int id;
	std::vector<node> sourceSet;
	edgeweight maxFlow = edKa.run(G, 0, 6, sourceSet, id);
	EXPECT_EQ(2, maxFlow) << "max flow is not correct";
	// FIXME: update to new edge attribute system
	EXPECT_TRUE(false) << "update to new edge attribute system";
	// EXPECT_EQ(1, G.attribute_double(4,6,id));
	// EXPECT_EQ(1, G.attribute_double(5,6,id));

	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 0) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 1) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 2) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 3) != sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 4) != sourceSet.end());

	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 5) == sourceSet.end());
	EXPECT_TRUE(std::find(sourceSet.begin(), sourceSet.end(), 6) == sourceSet.end());
}

TEST_F(EdmondsKarpGTest, tryEdmondsKarpP2) {
	Graph G(6, true);
	G.addEdge(0,1, 5);
{'fraction_non_alphanumeric': 0.20566885585896993, 'fraction_numerical': 0.036640165917732455, 'mean_word_length': 5.7146171693735495, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5885641', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1221, 'n_words': 199}