Блог пользователя ghost016

Автор ghost016, 13 лет назад, По-английски

Hi,

Is there a easy way to learn suffix array ??? i am finding it bit difficult to understand and code.

Thanks.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -7
  • Проголосовать: не нравится

Автор ghost016, 13 лет назад, По-английски
Hi...

I am facing problem while operator overloading in the priority queue... my following code snippet return wrong..

struct node
{
int vertex, dist;
node() {};
node(int v, int d) : vertex(v), dist(d) {};
};

bool operator < (node p, node q)
{
if(p.dist > q.dist)
return true;
else if(p.dist == q.dist)
{
if(p.vertex > q.vertex)
return true;
return false;
}
return false;
}

here .. the node priority is sorted according to distance, but when distance (suppose both are 0 ) is same then node is sorted according to the vertex number. for example it becomes

1 0
3 0
2 0
7 69
6 51
4 48    --> which is wrong

Thanks.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

Автор ghost016, 13 лет назад, По-английски

Hello all,

i have learned that for converting Bipartite graph to Maxflow, i need to introduce two vertices, super-source and super-sink and each edge will be assigned a capacity of "1" from the super-source to the vertices in one partition and to the super-sink from the vertices of another partition, and then apply the maxflow algorithm, where the maxflow is the max-matching. My question however is that is this system can be applied to the weighted bipartite graph, for finding the maximum weight of the graph ?? if not then is there any other method how i can reduce the weighted bipartite graph to maxflow problem. Hope to get some reply.

Thanking You
Ghost016

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор ghost016, 13 лет назад, По-английски
Hello all,

Recently i am stuck with a problem, which i was trying on my own for couple of days, i have two different trees which are weighted, weights are assigned in some basis which are not of the concern now, anywayz i thought of transforming it into bipartite graph and then find the maximum weighted matching between them, but next i thought of doing the maximum tree matching rather then transforming into graph and then doing the match, now i am stuck here, i really want to know how to do it. Many good coders are here, please any one help me with this.

ThankS
Ghost016

Полный текст и комментарии »

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится