While manipulating osm file of Chicago to find the optimal path using A* algorithm there are surely some segment roads which are restricted for heavy duties. Where can I found this information (a shapefile or a dataset) ? Which segements are allowed for heavy duty and which segments aren't? Any help please?
Not a perfect answer, but the current best option is the Functional Road Classification for a starting point. It is available on Chicago's data portal. The shapefiles have metadata attached to each road segment. The "Class" field will list the road classification and provides a rough guide.
Though not machine readable, this PDF lists those restrictions (especially bridges) that could be attached to the shapefile.
Also, there are viaducts and bridges. Here is a list of those heights.
Individual roads can have restrictions, posted on signs at intersections, such as "no trucks allowed," maximum tonnage, maximum tonnage per axle, and so on. You would expect that there would exist a dataset of these restrictions associated with road names. Unfortunately, it's not that simple.
There is something called the "National/State Truck Network." I wasn't able to find this data set; maybe you can find it in the National Transportation Library Catalog. You can see a map of this network here. However, this dataset only seems to cover major roads (mostly for interstate highways and state routes).
For the state of Illinois, there is the
IDOT Designated Truck Route List: Listing of all Designated Truck Routes under the jurisdiction of the State of Illinois Department of Transportation. Class I, II, and III roadways.
All the links to download this file from Data.gov are broken, but it's also available on data.illinois.gov. This is an ungeolocated table, so you'll need to join it to a vector layer of roads.
This only covers major routes, so smaller roads are still a bit of a mystery. You'll probably to restrict your routes to designated truck routes except where the start or end point is on a smaller road.
You could also look at some of the various routing apps and services for truck drivers, some of which are free. It seems that each of these services develops and maintains their own proprietary data sets, for example see this page. You could troubleshoot your algorithm by comparing a few test routes to the routes suggested by these services. Based on this discussion it seems no truck routing service is completely reliable.
Examples of truck routing services: Trucker Path Pro, Co Pilot, Sygic GPS Truck, NavMeTo, Truckmiles.com, Truck Router. Truckrouter.com is free; I haven't looked into the others.