Dalisyron's blog

By Dalisyron, history, 8 years ago, In English

Problem :

Given a weighted directed graph with both negative and positive edges, Find a path from vertex 1 to n, in which minimum subpath weight(starting from vertex 1) is maximum.

I can't think of any graph algorithm that can help me solve this problem, so any suggestions are appreciated.

N<=500

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +6 Vote: I do not like it

constraints?

»
8 years ago, # |
  Vote: I like it -14 Vote: I do not like it

easi task

»
8 years ago, # |
  Vote: I like it +7 Vote: I do not like it

Binary search for the answer plus BFS to check if it's possible. Details: think.

  • »
    »
    8 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    I've never heard of BFS on weighted graph ... how would that be done ?

    • »
      »
      »
      8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I parsed "subpath" as "edge"...

      If they're paths from vertex 1, it's modified Dijkstra (you only have to ignore possible paths with length < checked answer).

      • »
        »
        »
        »
        8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I used a combination of Dijkstra & DP and it worked. Thank You Xellos

»
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Could you please post the question link? I would like to solve it too.

Thanks in advance :)