Skip to content

# Project - Weighted and undirected graph model - very fast and accurate. Using Hashmaps. 11/2020

Notifications You must be signed in to change notification settings

shaCode256/Weighted-and-undirected-graph-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project - Weighted and undirected graph model - 11/2020

The project implements a Weighted and undirected graph model, using data structures including HashMaps to represent the nodes and neighborhood relationships between them.

This graph functions include:

  • Saving the graph into a file
  • Loading a graph from a file
  • Find the shortest route between two nodes using Dijkstra's algorithm, implemented by a queue
  • Returning the shortest path's between two nodes weight
  • Adding and deleting nodes to a graph
  • Add and delete neighbors to nodes in the graph
  • Receiving the neighbors of a particular junction
  • Adding information to the nodes themselves, in two information values ("variables") for each node
  • Checking the connectivity of the graph
  • Deep copy of the graph

Also, there are some RICH TESTS for you to test almost everything in there. Got any additions/ comments? I would love to hear.

How to use?

Download the code and put it where you can access it. You can start creating a graph by the command WGraph_DS g = new Wgraph_DS <> (); Then add nodes using the g.addNode (new NodeInfo (your desired new node key)) command. Continue as you wish. The project is full of descriptions about the functions and their use.

Let's take a look inside-

Pictures to help and visualize how it's going:

Creating a graph: Creating a graph

Creating Nodes: Creating Nodes

Running Tests0: Update- the new ver. is with time stamps Running Tests0

Running Tests1: Running Tests1

!Running Tests2: Running Tests2

GraphAlgo: (rithms, da ;) ) GraphAlgo(rithms)

The HashMap of the graph strcture: HashMap- Graph structure

Find me at GitHub: ShaCode256@ -Second assignment in computer science and mathematics studies at Ariel University, second year.

פרויקט- מודל גרף ממושקל ולא מכוון- 11/2020

הפרויקט מממש מודל גרף ממושקל ולא מכוון, באמצעות מבני נתונים ובתוכם HashMaps לייצוג הצמתים וקשרי השכנויות בינהם.

טיפוס הגרף בעל פונקציות, בין היתר:

  • הוספת ומחיקת צמתים לגרף
  • הוספת ומחיקת שכנים לצמתים בגרף
  • קבלת השכנים של צומת מסוים
  • הוספת מידע לצמתים עצמם, בשני ערכי מידע ("משתנים") לכל צומת
  • מציאת המסלול הקצר ביותר בין שני צמתים באמצעות אלגוריתם Dijkstra - מימוש באמצעות תור
  • בדיקת קשירות הגרף
  • העתקה עמוקה של הגרף

תמונות למעלה!

איך להשתמש?* הורידו את הקוד ושמרו אותו כך שתוכלו לגשת אליו**. אפשר להתחיל ביצירת גרף על ידי הפקודה WGraph_DS g = new WGraph_DS<>(); , לאחר מכן להוסיף צמתים באמצעות הפקודה g.addNode(new NodeInfo(yourDesiredKeyNode)) ומשם להמשיך כאוות נפשכם. הקוד מלא בתיאור הפונקציות והשימוש בהם.

@מצאו אותי בגיטהאב ShaCode256 מטלה ראשונה במסגרת לימודי מדעי המחשב ומתמטיקה באוניברסיטת אריאל בשומרון, שנה ב'.

About

# Project - Weighted and undirected graph model - very fast and accurate. Using Hashmaps. 11/2020

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages