-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBestEffort.hpp
More file actions
88 lines (59 loc) · 2.12 KB
/
Copy pathBestEffort.hpp
File metadata and controls
88 lines (59 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// BestEffort.h
// SocialNetWork
//
// Created by 王珏 on 15/12/22.
// Copyright © 2015年 王珏. All rights reserved.
//
#ifndef BestEffort_h
#define BestEffort_h
#include <iostream>
#include <queue>
#include <vector>
#include "Query.h"
#include "Graph.hpp"
using namespace std;
class Node;
class Graph;
class Query;
class BestEffort{
public:
priority_queue<Node> L;
priority_queue<Node> H;
priority_queue<Node>* release;
Graph* g;
Query* q;
double theta;
algorithm chooseAlgorithm;
vector<Node*>* L1;
vector<Node*>* L2;
bool loaded;
BestEffort(Graph* g,Query* q, double theta, algorithm chooseAlgorithm);
void Load();
void InitL();
void bestEffortOffline();
map<int, Node>* bestEffortOnline();
void insertCandidates(Query q);
//priority_queue<Node*> L;
};
//void initL(BestEffort* bestEffort,Graph g, double theta, algorithm chooseAlgorithm);
//void resetEdgeDistance(Graph* g);
double CalcMargin(Node u, Graph* g, double theta, Query gamma, map<int, Node> S);
void getLocalGraph(Tree tree,double theta,vector<Node> &nodes);
void localGraphBased(Graph* g,double theta,Query q);
void neighborhoodBased(Graph* g);
double estInfUB(Node node, Graph* g, double theta);
void precomputationBased(Graph* g, Query q);
void preprocessOnline(Graph* g, Query q);
double calDetaUSR(map<int, Node>&V, double theta);
void adjustM(Node& oldNode, double new_inf, priority_queue<Node>& M);
bool findNodeInM(const Node & findNode, priority_queue<Node> M);
double calPP(Edge edge, Query q);
double calPP(Node sourceNode,Node targetNode, Query q);
//double prodChild(Tree* node,map<int, Node> S,Query q);
//double calAP(Node& u, map<int, Node> S, Query &q);
double hat_delta_sigma(Node u,map<int, Node>S,Query q, algorithm choosAlgorithm);
double delta_sigma_v_S_gamma(Node v, map<int, Node> S_i, Query q, double theta, Graph* g);
double sigma(map<int, Node> nodes, Graph* g ,Query q);
double CalcMargin(Node u, Graph* g, double theta, Query gamma, map<int, Node> S);
#endif /* BestEffort_h */