Linking Subjects to Produce a Flowchart

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
revbackup
Forum Commoner
Posts: 29
Joined: Tue Jun 09, 2009 1:52 am

Linking Subjects to Produce a Flowchart

Post by revbackup »

I am making a flowchart out the subjects in the curriculum of our school.

a flowchart is generated through its preRequisite.... for example

FIRST YEAR FIRST SEMESTER
SUBJECTS ---- PREREQUISITE
MATH 1 ---- NONE
MATH 2 ---- NONE
ENGL 1 ---- NONE
SOCIO 1 ----- NONE
POLSCI 1 ----- NONE

FIRSTE YEAR SECOND SEMESTER
SUBJECTS ---- PREREQUISITE
MATH 3 ----- MATH 1
MATH 4 ----- MATH 2, MATH 1
ENGL 2 ----- ENGL 1
POLSCI 2 ----- POLSCI 1

So, I must print it this way, just using simple PHP but difficult Logic.:

MATH1 -----> MATH3
-----> MATH4
MATH 2 ----->MATH 4
ENGL1 -----> ENGL 2
SOCIO 1
POLSCI 1 -----> POLSCI 2

Can anyone give me a good algorithm for this, because this is really difficult.
I am planning to echo the results in an HTML table, and it makes it more complicated.

Do you have suggestions how to solve this problem properly and display the results also properly????

Thank you in advance!
Post Reply