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 6022645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:53:14+00:00 2026-05-23T03:53:14+00:00

A simple way to represent a graph is with a data structure of the

  • 0

A simple way to represent a graph is with a data structure of the form:

{1:[2,3],
 2:[1,3],
 3:[1,2]}

Where the keys in this dictionary are nodes, and the edges are represented by a list of other nodes they are connected to. This data structure could also easily represent a directed graph if the links are not symmetrical:

{1:[2],
 2:[3],
 3:[1]}

I don’t know much about the graph-theory, so what I’m about to propose might already have a simple solution, but I don’t know what to look for. I’ve encountered what I think is a situation where a graph is somewhat directed, depending on both the node you’re at, and the node you came from. To illustrate, I have a drawing:

Strangely Directional Graph

Imagine you’re speeding along edge A in a go-kart and at node 1 you hang a left onto edge B. Since you’re going so fast, when you hit node 3, you’re forced to continue onto edge F. However, if you were coming from edge F, you would be able to go on to either edge E or B. It is clear that node three is connected to 1 and 2, but whether or not you can reach them from that node depends on which direction you came from.

I’m wondering if there is a graph theory concept that describes this and/or if there is a simple data structure to describe it. While I’ll be writing my code in python, I’ll take advice coming from any reasonably applicable language.

Edit:
I tried to post an image to go along with this, but I’m not sure if it’s showing up. If it isn’t here’s a link to the image

Edit 2:
I should have been clear. The image posted is meant to be a portion of a complete graph, in which there are more nodes off screen from A, D, and F.

  • 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-23T03:53:15+00:00Added an answer on May 23, 2026 at 3:53 am

    This could be represented by a directed graph.

    Nodes in your graph could be represented as two nodes in the graph.
    Think of the nodes as representing locations on particular sides of a street — the edges being like inbound and outbound lanes.

    enter image description here

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

Sidebar

Related Questions

I am unclear what's the most appropriate way to represent simple data objects with
Is there a library/simple way to flip an image? Flip image like this: AABBCC
A simple XY line graph: The X axis will represent the complete range of
I'm looking for advice on the best way to represent this JSON object in
Does anyone know of a way to represent a tree structure in Crystal Reports?
A simple question about gnuplot. i have a data represented in a table, that
Is there a way I can build terrain data in a simple way from
Is there a simple way to see assigned shortcuts with given prefix? Something similar
Is there a simple way to have isometric projection? I mean the true isometric
Is there a simple way to work with C++ objects directly from C? I

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.