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

  • SEARCH
  • Home
  • 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 7079373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:39:52+00:00 2026-05-28T06:39:52+00:00

Given the following problem : Given the directed graph G=(V,E) with the weight function

  • 0

Given the following problem :

Given the directed graph G=(V,E) with the weight function W:V→R , describe an algorithm
that find the shortest paths from S to all other Vertices , where the length of the
path equals to the SUM of all the vertices.You need to change an existing algorithm ,
to make that work , so there’s no need to write a new algorithm.

Please notice that the weight function is on the Vertices and NOT(!!) on the Edges .
What I was thinking is to change the Bellman-Ford algorithm and change the Relax check to the following :

1.if d[v]>d[u]+w[u]
 1.1 d[v] <<--  d[u]+w[u]
 1.2 PI[v] <<-- u

I don’t think this works good enough , any idea what might be the problem ?

thanks ,Ron

  • 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-05-28T06:39:53+00:00Added an answer on May 28, 2026 at 6:39 am

    let w:V->R be your weight function.

    Create a weightening function: w':E->R as follows: w'(u,v) = w(v)

    Run dijkstra/bellman-ford with w’. let d'[v] be the minimal path’s weight to v, according to w’.

    Then if the shortest path is s->u1->u2->...->un->v, you get: d'[v] = w'(s,u1) + w'(u1,u2) + ... + w'(un,v) [by correctness of dijkstra/bellman fofrd] and thus d'[v] = w(u1) + w(u2) + ... + w(un) + w(v) [by definition of w’].

    so, at overall you get: d[v] = w(s) d'[v] and d[v] is the shortest path for vertices.

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

Sidebar

Related Questions

Does anyone know an algorithm for the following problem: Given a undirected connected graph
Please help me out with an algorithm for the following problem - Given a
Problem Given the following two tables, I'd like to select all Ids for Posts
The problem is the following: given two bipartite directed graphs represented in .dot files,
I'm currently having the following problem: I've got a TableView that is given TableRow's
suppose you are given the following problem. You have two index sets that have
need to find an expression for the following problem: String given = { \questionID\
The following problem is taken from Problems on Algorithms (Problem 653): You are given
I have the following problem: I am given a tree with N apples, for
Given the following html table and script shown below I am having a problem

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.