Hello,
i need a php-script which implements the a*-algorithm. So it should detect the shortest way between two given coordinates (for example from 4/5 to 10/12).
The script should return the shortest way respectively the fields which have to be passed as array.
There are fields which are impassable and also fields which can be set as waypoints by the user so the script must pay attention to this fields when detecting the shortest way. If It should be also possible to walk diagonal to other coordinates.
The script should be programmed professional so that also the performance/load time of it is good.
How are the coordinates sorted at the map at the moment?
x/y 1 2 3 4 5
1
2
3
4
5
How looks the table structure at the moment?
CREATE TABLE IF NOT EXISTS `map` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`x` varchar(5) COLLATE latin1_german2_ci DEFAULT NULL,
`y` varchar(5) COLLATE latin1_german2_ci DEFAULT NULL,
`user` varchar(10) COLLATE latin1_german2_ci DEFAULT NULL,
`type` varchar(10) COLLATE latin1_german2_ci DEFAULT NULL, // if field is passable or not
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;
Structure of the table and the map can be changed if necessary.
So if you have experiences in implementing the a*-algorithm via php i would like to hire you for this job.