Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8539121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:17:16+00:00 2026-06-11T11:17:16+00:00

while programing bellman-ford algorithm I encountered one problem, it’s question more theoretical than technical

  • 0

while programing bellman-ford algorithm I encountered one problem, it’s question more theoretical than technical but here it is:

I have 4 points A,B,C,D, cost from A to B equals 3 etc. here is the graph:

B--3--C
|     |
3     9
|     |
A--1--D

Let’s say I want to know what cost is from A to C via D, will it be: 10 ? or it will go from A to D (which cost is 1) then back from D to A (total cost is 1+1=2) then from A to B (1+1+3=5) and from B to C (1+1+3+3=8) so it will be 8 not 10 ?

I searched everywhere but I couldn’t find any rational answer to my question.

EDIT:
let’s say that for A->D and D->C paths count will be 2 and for A->D then D->A then A->B then B->C there will be total paths count equals 4 so will it choose the way with shortest paths count (paths count = 2) or the longer one (paths count = 4)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:17:18+00:00Added an answer on June 11, 2026 at 11:17 am

    For the via problem, I wouldn’t use single go of the algorithm; I would call it twice. First, for A -> D, then for D -> C, as that is practically the problem; then, final path is sum of those two.

    Note: I’m not familiar with Bellman-Ford algorithm; this answer is just a general remark regarding pathfinding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question occured to me while programming a Android application, but it seems to
I got an problem, im programing an antihack program but i dont have idea
Recently, I use Vim as my editor while programming Ruby, but I don't know
I know this question could be in vain, but it's just out of curiosity,
While programming a countdown script into the status bar but I still keep forced
I've been using Bloodshed Dev-C++ for C++ programing for a while now. I'd like
I found an interesting Programing question : What will be the values of a,b,c,f
I'm programing a TCP/IP Socketserver. My problem is, that my accept call is blocking
I'm currently encountering this issue while programming Metro, but I'm sure it applies to
I was just wondering, after programing in LUA (Roblox) for a while then switching

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.