Graph Real Time Problems

screenshot of Graph Real Time Problems

Points: 100 Topics: Graphs, topological sort, freedom to decide how to represent data and organize code (while still reading in a graph and performing topological sort) PLAGIARISM/COLLUSION: You should not read any code (solution) that directly solves this problem (e.g. implements DFS, topologica...

Overview

This program is designed to help users manage course prerequisites through a graph-based representation. By inputting a file containing a list of courses and their required prerequisites, users can compute the correct order in which to take courses. This is particularly useful for students navigating degree requirements, as it ensures that all necessary foundational courses are completed before advancing to higher-level classes.

The project emphasizes the importance of understanding graph theory, particularly topological sorting. It requires users to write their program without directly copying existing solutions, which fosters independent coding skills. Reading from a Unix file format adds an extra layer of complexity, encouraging developers to engage with file handling and tokenization in C programming.

Features

  • Graph Representation: The program allows users to represent courses and prerequisites as a graph, facilitating easier computations related to course order.
  • Topological Sorting: It implements a reliable algorithm to determine the order of courses, ensuring prerequisites are fulfilled in the correct sequence.
  • User Input: Users can specify the filename of the data file, making the program flexible and adaptable to various datasets.
  • C Language Compliance: The entire code must be written in C, adhering to strict programming guidelines that promote good practices.
  • Data File Formats: The program accepts several file formats, with Unix as the standard, providing versatility in input options.
  • Macro Usage: It encourages the use of macros and typedef for defining constants and data structures, improving code maintainability.
  • Dynamic and Static Memory: The program supports both dynamic and static memory allocation, allowing developers to choose the best method for their needs.
  • No Global Variables: The restriction on global or static variables promotes better memory management and encourages the use of function parameters for variable passing.