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

Автор Peregrine_Falcon, история, 5 лет назад, По-английски

I've a graph consisting of 22 nodes and 36 edges. It's an undirected graph. From each node, I've to find the number of ways that I can reach all other nodes. Any idea please?

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

»
5 лет назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

What are the rules here? Can you use one edge or vertex multiple times?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Yes. But in a path I can't use a cycle. Cause it'll give me a infinite answer. Two paths will consider different, if at least 1 edge deffer.

  • »
    »
    5 лет назад, # ^ |
    Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

    Sorry I was sleeping when I replied to your comment. So, I messed Up. In a path I cant use a edge multiple times. It will create a cycle. For graph -

    1 — 2

    2 — 4

    2 — 3

    4 — 3

    3 — 5

    If we consider the source 1 and target 5 output will be 2 for that. Like that from every node to all other node I've to find the number of ways. I don't have any time limit. I can run the code for few hours. I just need the output. Thank You.